MaterialApp简介
MaterialApp是WidgetsApp基础上继承实现的,其MaterialApp包括了一些列的Material Design风格基础组件,是用于构建Material Design 风格App的应用框架部件。用的比较多的。
MaterialApp属性概要
const MaterialApp({// 键Key key,// 导航键this.navigatorKey,// 主页this.home,// 路由this.routes = const <String, WidgetBuilder>{},// 初始路由this.initialRoute,// 生成路由this.onGenerateRoute,// 未知路由this.onUnknownRoute,// 导航观察器this.navigatorObservers = const <NavigatorObserver>[],// 生成器this.builder,// 标题this.title = '',// 生成标题this.onGenerateTitle,// 颜色this.color,// 主题this.theme,// 暗主题this.darkTheme,// 主题模式this.themeMode = ThemeMode.system,// 区域this.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,})
