close method
Releases any resources held by this sink. After close returns, the sink must not accept any more events.
Implementation
@override
Future<void> close() async {
_closed = true;
try {
await _tail;
await _out?.flush();
await _out?.close();
} catch (_) {}
_out = null;
}