set method

  1. @protected
  2. @visibleForTesting
Future<void> set(
  1. S value, {
  2. bool ignoreConcurrentUpdates = false,
})

Sets the service's state to the provided value directly, without needing changing the service into an intermediate loading state.

If ignoreConcurrentUpdates is true, any other state updates will be dropped, rather than queued, until the update has been resolved.

Implementation

@protected
@visibleForTesting
Future<void> set(S value, {bool ignoreConcurrentUpdates = false}) =>
    _update(() => _addState(ServiceStateIdle._(value)), ignoreConcurrentUpdates: ignoreConcurrentUpdates);