diff --git a/lib/provider.dart b/lib/provider.dart index 21eb871..170fa5c 100644 --- a/lib/provider.dart +++ b/lib/provider.dart @@ -46,7 +46,7 @@ class Provider extends StatefulWidget { static T of(BuildContext context) { final type = _typeOf<_InheritedProvider>(); final _InheritedProvider provider = - context.inheritFromWidgetOfExactType(type); + context.dependOnInheritedWidgetOfExactType(aspect: type); if (provider == null) { throw ProviderNotFoundError(T, context.widget.runtimeType);