From 055d5c4c174b11422f9d465efb613bcc659b6201 Mon Sep 17 00:00:00 2001 From: ivo Date: Mon, 24 Mar 2025 18:12:18 +0100 Subject: [PATCH] feat(theme): update primary color for improved dark mode contrast --- lib/src/app.dart | 2 +- lib/src/widgets/left_menu.dart | 53 ++++++++++++++++++++-------------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/lib/src/app.dart b/lib/src/app.dart index 4f539a3..307b593 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -68,7 +68,7 @@ class _AppState extends State with PreferencesMixin { darkTheme: ThemeData( useMaterial3: true, colorScheme: ColorScheme.fromSwatch( - primarySwatch: darkGrey, + primarySwatch: Colors.pink, backgroundColor: darkGrey.shade700, brightness: Brightness.dark, ), diff --git a/lib/src/widgets/left_menu.dart b/lib/src/widgets/left_menu.dart index 5cb7872..64a2f7b 100644 --- a/lib/src/widgets/left_menu.dart +++ b/lib/src/widgets/left_menu.dart @@ -51,30 +51,36 @@ class _LeftMenuState extends State with PreferencesMixin { children: [ Padding( // Minimal bottom padding - padding: EdgeInsets.only(bottom: 0).add(EdgeInsets.symmetric(horizontal: 16)), + padding: const EdgeInsets.only(bottom: 0) + .add(const EdgeInsets.symmetric(horizontal: 16)), child: Container( - padding: EdgeInsets.symmetric(vertical: 4.0), + padding: const EdgeInsets.symmetric(vertical: 4.0), child: Text("Quickgui $version", - style: const TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold)), + style: const TextStyle( + fontSize: 24.0, fontWeight: FontWeight.bold)), ), ), FutureBuilder( future: fetchQuickemuVersion(), - builder: (BuildContext context, AsyncSnapshot snapshot) { + builder: + (BuildContext context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { - return CircularProgressIndicator(); // or some other widget while waiting + return const CircularProgressIndicator(); // or some other widget while waiting } else { - String poweredByText = context.t('Powered by') + " Quickemu"; + String poweredByText = + "${context.t('Powered by')} Quickemu"; if (snapshot.hasData) { poweredByText += " ${snapshot.data}"; } return Padding( // Minimal top padding - padding: EdgeInsets.only(top: 0).add(EdgeInsets.symmetric(horizontal: 16)), + padding: const EdgeInsets.only(top: 0) + .add(const EdgeInsets.symmetric(horizontal: 16)), child: Container( child: Text(poweredByText, - style: const TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold)), - ), + style: const TextStyle( + fontSize: 12.0, fontWeight: FontWeight.bold)), + ), ); } }, @@ -98,21 +104,20 @@ class _LeftMenuState extends State with PreferencesMixin { Switch( value: Theme.of(context).colorScheme.brightness == Brightness.dark, - onChanged: null, - activeColor: Colors.grey[300], - activeTrackColor: Colors.grey[300], + activeColor: Colors.black26, + activeTrackColor: Theme.of(context).colorScheme.primary, inactiveThumbColor: Colors.grey[500], inactiveTrackColor: Colors.grey[300], - /* + onChanged: (value) { appSettings.useDarkMode = value; savePreference(prefThemeMode, value); }, - activeColor: Colors.white, - activeTrackColor: Colors.black26, - inactiveThumbColor: Theme.of(context).colorScheme.onPrimary, - inactiveTrackColor: Theme.of(context).colorScheme.primary, - */ + // activeColor: Colors.white, + // activeTrackColor: Colors.black26, + // inactiveThumbColor: + // Theme.of(context).colorScheme.onPrimary, + // inactiveTrackColor: Theme.of(context).colorScheme.primary, ), ], ), @@ -153,8 +158,10 @@ class _LeftMenuState extends State with PreferencesMixin { textAlign: TextAlign.center, text: TextSpan( style: DefaultTextStyle.of(context).style, - children: [ - TextSpan(text: 'Authors\n', style: TextStyle(fontWeight: FontWeight.bold)), + children: const [ + TextSpan( + text: 'Authors\n', + style: TextStyle(fontWeight: FontWeight.bold)), TextSpan(text: 'Yannick Mauray\n'), TextSpan(text: 'Mark Johnson\n'), TextSpan(text: 'Martin Wimpress\n'), @@ -165,9 +172,11 @@ class _LeftMenuState extends State with PreferencesMixin { textAlign: TextAlign.center, text: TextSpan( style: DefaultTextStyle.of(context).style, - children: [ + children: const [ TextSpan(text: '© 2021 - 2024\n'), - TextSpan(text: 'Quickemu Project\n', style: TextStyle(fontWeight: FontWeight.bold)), + TextSpan( + text: 'Quickemu Project\n', + style: TextStyle(fontWeight: FontWeight.bold)), ], ), ),