safeStreamClose static method
Safely closes a stream without throwing exceptions
Implementation
static Future<void> safeStreamClose(dynamic stream, {String? context}) async {
try {
if (stream != null && stream.close != null) {
await stream.close();
}
} catch (e) {
_log.warning('Error during safe stream close${context != null ? ' ($context)' : ''}: $e');
}
}