safeClose method
Implementation
FutureOr<void> safeClose([FutureOr<void> Function()? close]) async {
try {
final function = close ?? this?.close;
if (function == null) return;
final result = function();
if (result is Future) await result;
} catch (_) {}
}