无法在此自定义小部件上方找到正确的 Provider<Example>

问题描述

在下面的代码中,我没有收到任何错误...直到我调试并单击底部导航栏图标以导航到路线。然后该页面会在我的应用栏和底部导航栏之间显示红色错误框。

我收到以下错误

The following ProviderNotFoundException was thrown building TodaysReviewScreen(dirty):
Error: Could not find the correct Provider<Entries> above this TodaysReviewScreen Widget

This happens because you used a BuildContext that does not include the provider of your choice...

在 main.dart 中,我尝试将 MultiProvider 移到 runApp() 中,用它包装 MaterialApp,在 main_navigation.dart 中,我尝试用它包装 Scaffold。没有运气。

编辑:删除了所有不相关的代码

解决方法

已解决:这是一个区分大小写的导入,没有被标记为问题。