RefenaContainer constructor
RefenaContainer({
- PlatformHint platformHint = PlatformHint.unknown,
- List<
ProviderOverride< overrides = const [],BaseNotifier, dynamic> > - List<
BaseProvider< initialProviders = const [],BaseNotifier, dynamic> > - NotifyStrategy defaultNotifyStrategy = NotifyStrategy.equality,
- List<
RefenaObserver> observers = const [], - bool initImmediately = true,
Creates a RefenaContainer.
The platformHint gives the container a hint about the platform.
This abstraction is used by the inspector that does not depend on
Flutter.
The overrides
are used to override providers with a different value.
The initialProviders
are used to initialize providers right away.
Otherwise, the providers are initialized lazily when they are accessed.
The defaultNotifyStrategy defines when widgets and providers
are notified to rebuild.
The observers
is used to observe events.
The initImmediately
defines whether the container should be initialized
right away.
Implementation
RefenaContainer({
this.platformHint = PlatformHint.unknown,
List<ProviderOverride> overrides = const [],
List<BaseProvider> initialProviders = const [],
this.defaultNotifyStrategy = NotifyStrategy.equality,
List<RefenaObserver> observers = const [],
bool initImmediately = true,
}) : _overrides = _overridesToMap(overrides),
_overridesList = overrides,
_initialProviders = initialProviders,
observer = _observerListToSingleObserver(observers) {
if (initImmediately) {
init();
}
}