📅  最后修改于: 2022-03-11 15:00:04.089000             🧑  作者: Mango
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new DynamicTheme(
defaultBrightness: Brightness.light,
data: (brightness) => new ThemeData(
primarySwatch: Colors.indigo,
brightness: brightness,
),
themedWidgetBuilder: (context, theme) {
return new MaterialApp(
title: 'Flutter Demo',
theme: theme,
home: new MyHomePage(title: 'Flutter Demo Home Page'),
);
}
);
}
}