在Flutter中重建MaterialApp小部件时出现灰屏

时间:2020-11-01 14:57:35

标签: flutter mobx

我正在使用Mobx进行状态控制。当我更改为themeMode屏幕呈灰色并返回到第一个屏幕时。但是调试模式可以正常工作并且没有错误。配置文件模式,引发以下错误消息。释放模式下也存在相同错误< / p>

 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()
      );}
    ),

0 个答案:

没有答案