setState method

  1. @override
void setState(
  1. S update, {
  2. String? event,
})
override

Called by blocs (subclasses) when the state is updated

isBusy and error are cleared whenever the state is updated Optional argument event is the name of event which is calling setState

Implementation

@override
void setState(S update, {String? event}) {
  super.setState(update, event: event);

  if (state == update && _autoPersistence) {
    _persistenceService.set('value', state);
  }
}