set method

void set(
  1. T newState
)

To set the state, you can use set method.

Example:

counterProvider.set(1);

Implementation

void set(T newState) {
  if (newState == _state) return;
  _state = newState;
  notifyListeners();
}