diff --git a/lib/components/message.dart b/lib/components/message.dart index 3618e40..e5038de 100644 --- a/lib/components/message.dart +++ b/lib/components/message.dart @@ -290,6 +290,7 @@ class ContentDialog extends StatelessWidget { : const EdgeInsets.symmetric(horizontal: 16), elevation: 2, shadowColor: context.colorScheme.shadow, + backgroundColor: context.colorScheme.surface, child: AnimatedSize( duration: const Duration(milliseconds: 200), alignment: Alignment.topCenter, diff --git a/lib/main.dart b/lib/main.dart index dd6fa77..5f0208a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -156,30 +156,40 @@ class _MyAppState extends State with WidgetsBindingObserver { home = const MainPage(); } return DynamicColorBuilder(builder: (light, dark) { - if (appdata.settings['color'] != 'system' || light == null || dark == null) { + if (appdata.settings['color'] != 'system' || + light == null || + dark == null) { var color = translateColorSetting(); light = ColorScheme.fromSeed( seedColor: color, + surface: Colors.white, ); dark = ColorScheme.fromSeed( seedColor: color, brightness: Brightness.dark, + surface: Colors.black, + ); + } else { + light = ColorScheme.fromSeed( + seedColor: light.primary, + surface: Colors.white, + ); + dark = ColorScheme.fromSeed( + seedColor: dark.primary, + brightness: Brightness.dark, + surface: Colors.black, ); } return MaterialApp( home: home, debugShowCheckedModeBanner: false, theme: ThemeData( - colorScheme: light.copyWith( - surface: Colors.white, - ), + colorScheme: light, fontFamily: App.isWindows ? "Microsoft YaHei" : null, ), navigatorKey: App.rootNavigatorKey, darkTheme: ThemeData( - colorScheme: dark.copyWith( - surface: Colors.black, - ), + colorScheme: dark, fontFamily: App.isWindows ? "Microsoft YaHei" : null, ), themeMode: switch (appdata.settings['theme_mode']) { @@ -211,8 +221,8 @@ class _MyAppState extends State with WidgetsBindingObserver { ], builder: (context, widget) { ErrorWidget.builder = (details) { - Log.error( - "Unhandled Exception", "${details.exception}\n${details.stack}"); + Log.error("Unhandled Exception", + "${details.exception}\n${details.stack}"); return Material( child: Center( child: Text(details.exception.toString()),