MaterialApp({Key key, String title: '', GenerateAppTitle onGenerateTitle, Color color, ThemeData theme, Widget home, Map<String, WidgetBuilder> routes: const {}, String initialRoute, RouteFactory onGenerateRoute, RouteFactory onUnknownRoute, Locale locale, Iterable<LocalizationsDelegate> localizationsDelegates, LocaleResolutionCallback localeResolutionCallback, Iterable<Locale> supportedLocales: const [const Locale('en', 'US')], List<NavigatorObserver> navigatorObservers: const [], bool debugShowMaterialGrid: false, bool showPerformanceOverlay: false, bool checkerboardRasterCacheImages: false, bool checkerboardOffscreenLayers: false, bool showSemanticsDebugger: false, bool debugShowCheckedModeBanner: true })

Creates a MaterialApp.

At least one of home, routes, or onGenerateRoute must be given. If only routes is given, it must include an entry for the Navigator.defaultRouteName (/), since that is the route used when the application is launched with an intent that specifies an otherwise unsupported route.

This class creates an instance of WidgetsApp.

The boolean arguments, routes, and navigatorObservers, must not be null.

Source

MaterialApp({ // can't be const because the asserts use methods on Map :-(
  Key key,
  this.title: '',
  this.onGenerateTitle,
  this.color,
  this.theme,
  this.home,
  this.routes: const <String, WidgetBuilder>{},
  this.initialRoute,
  this.onGenerateRoute,
  this.onUnknownRoute,
  this.locale,
  this.localizationsDelegates,
  this.localeResolutionCallback,
  this.supportedLocales: const <Locale>[const Locale('en', 'US')],
  this.navigatorObservers: const <NavigatorObserver>[],
  this.debugShowMaterialGrid: false,
  this.showPerformanceOverlay: false,
  this.checkerboardRasterCacheImages: false,
  this.checkerboardOffscreenLayers: false,
  this.showSemanticsDebugger: false,
  this.debugShowCheckedModeBanner: true
}) : assert(title != null),
     assert(routes != null),
     assert(navigatorObservers != null),
     assert(debugShowMaterialGrid != null),
     assert(showPerformanceOverlay != null),
     assert(checkerboardRasterCacheImages != null),
     assert(checkerboardOffscreenLayers != null),
     assert(showSemanticsDebugger != null),
     assert(debugShowCheckedModeBanner != null),
     assert(
       home == null ||
       !routes.containsKey(Navigator.defaultRouteName),
       'If the home property is specified, the routes table '
       'cannot include an entry for "/", since it would be redundant.'
     ),
     assert(
       home != null ||
       routes.containsKey(Navigator.defaultRouteName) ||
       onGenerateRoute != null ||
       onUnknownRoute != null,
       'Either the home property must be specified, '
       'or the routes table must include an entry for "/", '
       'or there must be on onGenerateRoute callback specified, '
       'or there must be an onUnknownRoute callback specified, '
       'because otherwise there is nothing to fall back on if the '
       'app is started with an intent that specifies an unknown route.'
     ),
     super(key: key);