Flutter MaterialApp
1 作用
MaterialApp 代表 Material 设计风格的应用。常用于定义APP 的统一默认风格,用作程序的入口
2 案例一
```
import 'package:flutter/material.dart';
import 'package:flutter/material.dart';
//Flutter程序入口
void main() => runApp(getApp());
Widget getApp() {
return new MaterialApp(
//应用默认所显示的界面 页面
home: new Container(color: Colors.grey,),
//应用的顶级导航表格,多页面应用 控制页面跳转
//routes: ,
// 当系统修改语言的时候,会触发å这个回调
//onLocaleChanged :
// 应用各种 UI 所使用的主题颜色
theme: ThemeData.light().copyWith(
primaryColor: Colors.grey[850],
accentColor: Colors.grey[850],
indicatorColor: Colors.white,
),
);
}
```

3 构造参数简述
this.navigatorKey, // 导航的key
this.home, // 主页
this.routes = const <String, WidgetBuilder>{},// 路由
this.initialRoute,//初始路由
this.onGenerateRoute,//生成路由
this.onUnknownRoute,//位置路由
this.navigatorObservers = const <NavigatorObserver>[],//导航的观察者
this.builder,//widget的构建
this.title = '',//设备用于识别用户的应用程序的单行描述。在Android上,标题显示在任务管理器的应用程序快照上方,当用户按下“最近的应用程序”按钮时会显示这些快照。 在iOS上,无法使用此值。 来自应用程序的`Info.plist`的`CFBundleDisplayName`在任何时候都会被引用,否则就会引用`CFBundleName`。要提供初始化的标题,可以用 onGenerateTitle。
this.onGenerateTitle,//每次在WidgetsApp构建时都会重新生成
this.color,//背景颜色
this.theme,//主题,用ThemeData
this.locale,//app语言支持
this.localizationsDelegates,//多语言代理
this.localeResolutionCallback,//
this.supportedLocales = const <Locale>[Locale('en', 'US')],//支持的多语言
this.debugShowMaterialGrid = false,//显示网格
this.showPerformanceOverlay = false,//打开性能监控,覆盖在屏幕最上面
this.checkerboardRasterCacheImages = false,
this.checkerboardOffscreenLayers = false,
this.showSemanticsDebugger = false,//打开一个覆盖图,显示框架报告的可访问性信息 显示边框
this.debugShowCheckedModeBanner = true,//右上角显示一个debug的图标