isStreamClosureError static method

bool isStreamClosureError(
  1. dynamic error
)

Checks if an error is a stream closure error that should be silently handled

Implementation

static bool isStreamClosureError(dynamic error) {
  return error is StateError &&
         error.message.contains('Cannot add event after closing');
}