InheritedProvider<T> constructor
InheritedProvider<T> ({
- Key? key,
- Create<
T> ? create, - T update(
- BuildContext context,
- T? value
- UpdateShouldNotify<
T> ? updateShouldNotify, - void debugCheckInvalidValueType(
- T value
- StartListening<
T> ? startListening, - Dispose<
T> ? dispose, - TransitionBuilder? builder,
- bool? lazy,
- Widget? child,
Provides the value create makes, or update makes anew; one of
them is given.
Implementation
InheritedProvider({
super.key,
Create<T>? create,
T Function(BuildContext context, T? value)? update,
UpdateShouldNotify<T>? updateShouldNotify,
void Function(T value)? debugCheckInvalidValueType,
StartListening<T>? startListening,
Dispose<T>? dispose,
this.builder,
bool? lazy,
super.child,
}) : assert(
create != null || update != null,
'an InheritedProvider needs a create or an update',
),
lazy = lazy ?? true,
_delegate = _CreateDelegate(
create: create,
update: update,
updateShouldNotify: updateShouldNotify,
debugCheckInvalidValueType: debugCheckInvalidValueType,
startListening: startListening,
dispose: dispose,
);