maintainState property

  1. @Deprecated('Use `keepAlive()` instead')
  2. @override
bool get maintainState
inherited

Whether to destroy the state of the provider when all listeners are removed or not.

Can be changed at any time, in which case when setting it to false, may destroy the provider state if it currently has no listeners.

Defaults to false.

Implementation

@Deprecated('Use `keepAlive()` instead')
@override
bool get maintainState => _maintainState;
  1. @override
set maintainState (bool value)
inherited

Implementation

@override
set maintainState(bool value) {
  _maintainState = value;
  if (!value) mayNeedDispose();
}