onceState method Null safety

dynamic onceState(
  1. STATES_ENUM state,
  2. dynamic callback(
    1. PluginEvent<STATES_ENUM>
    )
)

Executes the callback once state is emitted

Implementation

onceState(
  STATES_ENUM state,
  dynamic Function(PluginEvent<STATES_ENUM>) callback,
) {
  once(events, callback, condition: () => this.state == state);
}