如何解决在Flutter中重建MaterialApp小部件时出现灰屏
我正在使用Mobx进行状态控制。当我更改为themeMode屏幕呈灰色并返回到第一个屏幕时。但是调试模式可以正常工作并且没有错误。配置文件模式,引发以下错误消息。释放模式下也存在相同错误
Another exception was thrown: Instance of 'ErrorSummary'
这里是'main.dart'
Observer(
builder:(_){
return MaterialApp(
localizationsDelegates: context.localizationDelegates,supportedLocales: context.supportedLocales,locale: context.locale,navigatorKey: navigator,title: 'Hello',theme: AppTheme.lightTheme,darkTheme: ThemeData.dark().copyWith(
tabBarTheme: TabBarTheme(indicator: Shapedecoration(shape: Border(bottom: BorderSide(color: blue)))),accentColor: Colors.blue,primaryColor:Colors.blue,canvasColor: darkBackground,scaffoldBackgroundColor: darkBackground,bottomNavigationBarTheme:
BottomNavigationBarThemeData(backgroundColor: darkBackground),textTheme: TextTheme(bodyText2: TextStyle(color: gray))),themeMode:navigationStore.darkModeEnabled?ThemeMode.dark:ThemeMode.light,home: navigationStore.isFirst ? Introduction():MainPage()
);}
),
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。