To set the state, you can use set method.
Example:
counterProvider.set(1);
void set(T newState) { if (newState == _state) return; _state = newState; notifyListeners(); }