close method
Closes the file handler and underlying file sink.
This method ensures that all buffered data is written to disk by calling IOSink.flush before closing it. If the handler is already closed, this method returns immediately.
Implementation
@override
Future<void> close() async {
if (_isClosed) {
return;
}
_isClosed = true;
await super.close();
await _sink.flush();
await _sink.close();
}