onBind method Null safety

void onBind(
  1. Dispatcher dispatcher
)

Implementation

void onBind(Dispatcher dispatcher) {
  if (_dispatched) {
    throw Exception('Action is already dispatched');
  }
  _dispatched = true;
  this.dispatcher = dispatcher;
  dispatcher.on(
    done: () => _doneEmitter.emit(null),
    success: () => _successEmitter.emit(null),
    error: (e) => _errorEmitter.emit(e),
    dispose: () => _disposeEmitter.emit(null),
  );
}