RefenaScope constructor
RefenaScope({
- Key? key,
- PlatformHint? platformHint,
- List<
ProviderOverride< overrides = const [],BaseNotifier, dynamic> > - List<
BaseProvider< initialProviders = const [],BaseNotifier, dynamic> > - NotifyStrategy defaultNotifyStrategy = NotifyStrategy.identity,
- List<
RefenaObserver> observers = const [], - bool defaultRef = true,
- required Widget child,
Creates a RefenaScope. It will create an implicit RefenaContainer that will be disposed when the RefenaScope is disposed.
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
are used to observe events.
The child
is the widget tree that is wrapped by the RefenaScope.
Implementation
RefenaScope({
Key? key,
PlatformHint? platformHint,
List<ProviderOverride> overrides = const [],
List<BaseProvider> initialProviders = const [],
NotifyStrategy defaultNotifyStrategy = NotifyStrategy.identity,
List<RefenaObserver> observers = const [],
bool defaultRef = true,
required Widget child,
}) : this._(
key: key,
container: RefenaContainer(
platformHint: platformHint ?? RefenaScope.getPlatformHint(),
overrides: overrides,
initialProviders: initialProviders,
defaultNotifyStrategy: defaultNotifyStrategy,
observers: observers,
initImmediately: false,
),
implicitContainer: true,
ownsContainer: true,
defaultRef: defaultRef,
child: child,
);