MaterialApp({Key key, String title, Color color, ThemeData theme, Widget home, Map<String, WidgetBuilder> routes: const {}, String initialRoute, RouteFactory onGenerateRoute, LocaleChangedCallback onLocaleChanged, bool debugShowMaterialGrid: false, bool showPerformanceOverlay: false, bool checkerboardRasterCacheImages: 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 ('/').

This class creates an instance of WidgetsApp.

Source

MaterialApp({
  Key key,
  this.title,
  this.color,
  this.theme,
  this.home,
  this.routes: const <String, WidgetBuilder>{},
  this.initialRoute,
  this.onGenerateRoute,
  this.onLocaleChanged,
  this.debugShowMaterialGrid: false,
  this.showPerformanceOverlay: false,
  this.checkerboardRasterCacheImages: false,
  this.showSemanticsDebugger: false,
  this.debugShowCheckedModeBanner: true
}) : super(key: key) {
  assert(debugShowMaterialGrid != null);
  assert(routes != null);
  assert(!routes.containsKey(Navigator.defaultRouteName) || (home == null));
  assert(routes.containsKey(Navigator.defaultRouteName) || (home != null) || (onGenerateRoute != null));
 }