Skip to content

Commit

Permalink
InheritedProvider -> InheritedProvider.value
Browse files Browse the repository at this point in the history
  • Loading branch information
rrousselGit committed Oct 13, 2019
1 parent b16d511 commit 99e0942
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/provider/lib/src/async_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class StreamProvider<T> extends ValueDelegateWidget<Stream<T>>
stream: delegate.value,
initialData: initialData,
builder: (_, snapshot) {
return InheritedProvider<T>(
return InheritedProvider<T>.value(
value: _snapshotToValue(snapshot, context, catchError, this),
child: child,
updateShouldNotify: updateShouldNotify,
Expand Down Expand Up @@ -302,7 +302,7 @@ class FutureProvider<T> extends ValueDelegateWidget<Future<T>>
future: delegate.value,
initialData: initialData,
builder: (_, snapshot) {
return InheritedProvider<T>(
return InheritedProvider<T>.value(
value: _snapshotToValue(snapshot, context, catchError, this),
updateShouldNotify: updateShouldNotify,
child: child,
Expand Down
2 changes: 1 addition & 1 deletion packages/provider/lib/src/listenable_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ListenableProvider<T extends Listenable> extends ValueDelegateWidget<T>
@override
Widget build(BuildContext context) {
final delegate = this.delegate as _ListenableDelegateMixin<T>;
return InheritedProvider<T>(
return InheritedProvider<T>.value(
value: delegate.value,
updateShouldNotify: delegate.updateShouldNotify,
child: child,
Expand Down
4 changes: 2 additions & 2 deletions packages/provider/lib/src/provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class SingleChildCloneableWidget implements Widget {
/// Instead use [Provider] class, which wraps [InheritedProvider].
class InheritedProvider<T> extends InheritedWidget {
/// Allow customizing [updateShouldNotify].
const InheritedProvider({
const InheritedProvider.value({
Key key,
@required T value,
UpdateShouldNotify<T> updateShouldNotify,
Expand Down Expand Up @@ -337,7 +337,7 @@ void main() {
Provider.debugCheckInvalidValueType?.call<T>(delegate.value);
return true;
}());
return InheritedProvider<T>(
return InheritedProvider<T>.value(
value: delegate.value,
updateShouldNotify: updateShouldNotify,
child: child,
Expand Down
2 changes: 1 addition & 1 deletion packages/provider/lib/src/proxy_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class NumericProxyProvider<T, T2, T3, T4, T5, T6, R>
Provider.debugCheckInvalidValueType?.call(value);
return true;
}());
return InheritedProvider<R>(
return InheritedProvider<R>.value(
value: value,
updateShouldNotify: updateShouldNotify,
child: child,
Expand Down
2 changes: 1 addition & 1 deletion packages/provider/lib/src/value_listenable_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class ValueListenableProvider<T> extends ValueDelegateWidget<ValueListenable<T>>
return ValueListenableBuilder<T>(
valueListenable: delegate.value,
builder: (_, value, child) {
return InheritedProvider<T>(
return InheritedProvider<T>.value(
value: value,
updateShouldNotify: updateShouldNotify,
child: child,
Expand Down

0 comments on commit 99e0942

Please sign in to comment.