在下面的代码中,我没有收到任何错误...直到我调试并单击底部导航栏图标以导航到该路线。然后该页面会在我的应用栏和底部导航栏之间显示红色的错误框。
我收到以下错误:
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。没运气。
编辑:删除所有代码,因为它不相关。