如题,示例程序的主题颜色并不能被修改。
谢谢。
是的,看来是无效的。如下可修改:
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
ThemeData themeData = ThemeData(
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.orange,)
);
return MaterialApp(
title: 'Welcome to Flutter',
theme: themeData,
home: const RandomWords());
}
}