Provider<T>.value constructor
Provider<T>.value ({
- Key? key,
- required T value,
- UpdateShouldNotify<
T> ? updateShouldNotify, - TransitionBuilder? builder,
- Widget? child,
Expose an existing value without disposing it.
updateShouldNotify
can optionally be passed to avoid unnecessarily
rebuilding dependents when Provider is rebuilt but value
did not change.
Defaults to (previous, next) => previous != next
.
See InheritedWidget.updateShouldNotify for more information.
Implementation
Provider.value({
Key? key,
required T value,
UpdateShouldNotify<T>? updateShouldNotify,
TransitionBuilder? builder,
Widget? child,
}) : assert(() {
Provider.debugCheckInvalidValueType?.call<T>(value);
return true;
}()),
super.value(
key: key,
builder: builder,
value: value,
updateShouldNotify: updateShouldNotify,
child: child,
);