added black color to background and canvas

This commit is contained in:
shilangyu 2020-09-08 16:31:04 +02:00
parent ffa484d895
commit f0d508c37a
1 changed files with 18 additions and 12 deletions

View File

@ -34,18 +34,24 @@ Future<void> main() async {
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => Observer(
builder: (ctx) => MaterialApp(
title: 'Flutter Demo',
themeMode: ctx.watch<ConfigStore>().theme,
darkTheme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: ctx.watch<ConfigStore>().amoledDarkMode
? Colors.black
: null),
theme: ThemeData(
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter hello world'),
),
builder: (ctx) {
var maybeAmoledColor =
ctx.watch<ConfigStore>().amoledDarkMode ? Colors.black : null;
return MaterialApp(
title: 'Flutter Demo',
themeMode: ctx.watch<ConfigStore>().theme,
darkTheme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: maybeAmoledColor,
backgroundColor: maybeAmoledColor,
canvasColor: maybeAmoledColor,
),
theme: ThemeData(
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter hello world'),
);
},
);
}