MaterialApp 是我们app开发中常用的符合MaterialApp Design设计理念的入口Widget。
MaterialApp({
Key key,
this.title = '',
this.home,
this.color,
this.theme,
this.routes = const <String, WidgetBuilder>{},
this.navigatorKey,
this.initialRoute,
this.onGenerateRoute,
this.onUnknownRoute,
this.navigatorObservers = const <NavigatorObserver>[],
this.builder,
this.onGenerateTitle,
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,
})
title:Text("Flutter Demo"),
home: MyApp(),
内容为map健值对;key为路由名称,value为路由对应的页面。页面需要跳转时,可以通过Navigator.pushNamed(context, 'rooteName');来跳转,
theme: ThemeData(
primaryColor: Colors.red,
),
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。