I'm very in trouble and want to help.
When I use Provider(not MultiProvider), Could not find the correct Provider<LaborModel>is not happend and works correctly.
However when I use MultiProvider, the error was happen.
I have already ensured the Provider
My full application with the error
https://github.com/kazumaz/dama_app
version
provider: ^4.0.2
my source Excerpt
providers: [
ChangeNotifierProvider<RewordModel>(create: (_) => RewordModel()),
ChangeNotifierProvider<LaborModel>(create: (_) => LaborModel()),
ChangeNotifierProvider<PointModel>(create: (_) => PointModel()),
],
my source Excerpt
Widget build(BuildContext context) {
return Consumer<LaborModel>(builder: (context, laborModel, child) {
return Scaffold(
body: ListView.builder(
itemBuilder: (BuildContext context, int index) {
return Card(
child: Padding(
child: Text(
laborModel.rewardList[index].point.toString() + " Point:  " + laborModel.rewardList[index].name,
style: TextStyle(fontSize: 22.0),
),
padding: EdgeInsets.all(20.0),
),
);
},
itemCount: laborModel.rewardList.length,
),
);
});
}
ERROR log
flutter: The following ProviderNotFoundException was thrown building Consumer<LaborModel>(dirty):
flutter: Error: Could not find the correct Provider<LaborModel> above this Consumer<LaborModel> Widget
(base) kazumanoMacBook-Air:dama_app kazuma$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.1 19B88, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
[✓] Android Studio (version 3.5)
[!] IntelliJ IDEA Community Edition (version 2019.2.4)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.42.0)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
(base) kazumanoMacBook-Air:dama_app kazuma$
i have fixed, sorry
@kazumaz what was the solution? I am facing the same issue
Most helpful comment
@kazumaz what was the solution? I am facing the same issue