dispose static method

void dispose()

Tears down the SSE connection and cancels any pending reconnect timer.

Call this in the dispose() method of the widget that owns the BuildContext passed to init.

@override
void dispose() {
  FlushbarRemote.dispose();
  super.dispose();
}

Implementation

static void dispose() {
  _disposed = true;
  WidgetsBinding.instance.removeObserver(_instance);
  _disconnect();
  _context = null;
}