1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
const MaterialApp({
Key key,
this.navigatorKey,
this.home, // 主界面的内容 widget
this.routes = const <String, WidgetBuilder>{}, // 带 router 和路由跳转有关
this.initialRoute,
this.onGenerateRoute,
this.onUnknownRoute,
this.navigatorObservers = const <NavigatorObserver>[],
this.builder,
this.title = '', // *类似标题
this.onGenerateTitle, // 主要用于多语言情况下,需要根据当前语言替换 title,需要使用该值
this.color, // 主题色,如果该值未设置,取 theme.primaryColor,未设置 theme 则取蓝色
this.theme, // App 的主题风格,包括主题色,按钮默认颜色等等
this.locale, // 带 locale 的和多语言适配相关
this.localizationsDelegates,
this.localeListResolutionCallback,
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 模式下,是否显示 DEBUG 标示横幅
})
|