You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I/flutter ( 3783): Error: Could not find the correct Provider<MyRepo> above this DynamicScada Widget
I/flutter ( 3783):
I/flutter ( 3783): This happens because you used a `BuildContext` that does not include the provider
I/flutter ( 3783): of your choice. There are a few common scenarios:
I/flutter ( 3783):
I/flutter ( 3783): - You added a new provider in your `main.dart` and performed a hot-reload.
I/flutter ( 3783): To fix, perform a hot-restart.
I/flutter ( 3783):
I/flutter ( 3783): - The provider you are trying to read is in a different route.
I/flutter ( 3783):
I/flutter ( 3783): Providers are "scoped". So if you insert of provider inside a route, then
I/flutter ( 3783): other routes will not be able to access that provider.
I/flutter ( 3783):
I/flutter ( 3783): - You used a `BuildContext` that is an ancestor of the provider you are trying to read.
I/flutter ( 3783):
I/flutter ( 3783): Make sure that DynamicScada is under your MultiProvider/Provider<MyRepo>.
I/flutter ( 3783): This usually happens when you are creating a provider and trying to read it immediately.
I/flutter ( 3783):
I/flutter ( 3783): For example, instead of:
I/flutter ( 3783):
I/flutter ( 3783): ```
I/flutter ( 3783): Widget build(BuildContext context) {
I/flutter ( 3783): return Provider<Example>(
I/flutter ( 3783): create: (_) => Example(),
I/flutter ( 3783): // Will throw a ProviderNotFoundError, because `context` is associated
I/flutter ( 3783): // to the widget that
And I Provider MyRepo in root level
The text was updated successfully, but these errors were encountered:
I just want to use Provider to inject repository to dynamic widget, and I get some error
and I get
And I Provider MyRepo in root level
The text was updated successfully, but these errors were encountered: