ValueListenableProvider<T>.value constructor
- {Key key,
- @required ValueListenable<
T> value, - UpdateShouldNotify<
T> updateShouldNotify, - TransitionBuilder builder,
- Widget child}
Listens to value
and exposes its current value.
Changing value
will stop listening to the previous value
and listen
the new one. Removing ValueListenableProvider from the tree will also
stop listening to value
.
ValueListenable<int> foo;
ValueListenableProvider<int>.value(
valueListenable: foo,
child: Container(),
);
Implementation
ValueListenableProvider.value({
Key key,
@required ValueListenable<T> value,
UpdateShouldNotify<T> updateShouldNotify,
TransitionBuilder builder,
Widget child,
}) : super.value(
key: key,
builder: builder,
value: value,
updateShouldNotify: updateShouldNotify,
startListening: _startListening(),
child: child,
);