runMainApp function

void runMainApp()

Implementation

void runMainApp()
{
  // hides all render flex exceptions
  FlutterError.onError = (details)
  {
    bool show = false;
    if (details.exception.toString().startsWith("A Render")) show = false;
    if (show) FlutterError.presentError(details);
  };

  // run the application
  runApp(ChangeNotifierProvider<ThemeNotifier>(
      create: (_)
      {
        try
        {
          var font = System.theme.font;
          return ThemeNotifier(fml_theme.MyTheme().deriveTheme(System.theme.colorscheme, googleFont: font));
        }
        catch(e)
        {
          Log().debug('Init Theme Error: $e \n(Configured fonts from https://fonts.google.com/ are case sensitive)');
          return ThemeNotifier(fml_theme.MyTheme().deriveTheme(System.theme.colorscheme));
        }
      },
      child: Application(key: applicationKey = GlobalKey())));
}