feat(theme): update primary color for improved dark mode contrast

This commit is contained in:
ivo 2025-03-24 18:12:18 +01:00 committed by Martin Wimpress
parent d5bd359a43
commit 18e0c20ccb
2 changed files with 32 additions and 23 deletions

View File

@ -68,7 +68,7 @@ class _AppState extends State<App> with PreferencesMixin {
darkTheme: ThemeData( darkTheme: ThemeData(
useMaterial3: true, useMaterial3: true,
colorScheme: ColorScheme.fromSwatch( colorScheme: ColorScheme.fromSwatch(
primarySwatch: darkGrey, primarySwatch: Colors.pink,
backgroundColor: darkGrey.shade700, backgroundColor: darkGrey.shade700,
brightness: Brightness.dark, brightness: Brightness.dark,
), ),

View File

@ -51,30 +51,36 @@ class _LeftMenuState extends State<LeftMenu> with PreferencesMixin {
children: [ children: [
Padding( Padding(
// Minimal bottom 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( child: Container(
padding: EdgeInsets.symmetric(vertical: 4.0), padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Text("Quickgui $version", child: Text("Quickgui $version",
style: const TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold)), style: const TextStyle(
fontSize: 24.0, fontWeight: FontWeight.bold)),
), ),
), ),
FutureBuilder<String>( FutureBuilder<String>(
future: fetchQuickemuVersion(), future: fetchQuickemuVersion(),
builder: (BuildContext context, AsyncSnapshot<String> snapshot) { builder:
(BuildContext context, AsyncSnapshot<String> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); // or some other widget while waiting return const CircularProgressIndicator(); // or some other widget while waiting
} else { } else {
String poweredByText = context.t('Powered by') + " Quickemu"; String poweredByText =
"${context.t('Powered by')} Quickemu";
if (snapshot.hasData) { if (snapshot.hasData) {
poweredByText += " ${snapshot.data}"; poweredByText += " ${snapshot.data}";
} }
return Padding( return Padding(
// Minimal top 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: Container(
child: Text(poweredByText, 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<LeftMenu> with PreferencesMixin {
Switch( Switch(
value: Theme.of(context).colorScheme.brightness == value: Theme.of(context).colorScheme.brightness ==
Brightness.dark, Brightness.dark,
onChanged: null, activeColor: Colors.black26,
activeColor: Colors.grey[300], activeTrackColor: Theme.of(context).colorScheme.primary,
activeTrackColor: Colors.grey[300],
inactiveThumbColor: Colors.grey[500], inactiveThumbColor: Colors.grey[500],
inactiveTrackColor: Colors.grey[300], inactiveTrackColor: Colors.grey[300],
/*
onChanged: (value) { onChanged: (value) {
appSettings.useDarkMode = value; appSettings.useDarkMode = value;
savePreference(prefThemeMode, value); savePreference(prefThemeMode, value);
}, },
activeColor: Colors.white, // activeColor: Colors.white,
activeTrackColor: Colors.black26, // activeTrackColor: Colors.black26,
inactiveThumbColor: Theme.of(context).colorScheme.onPrimary, // inactiveThumbColor:
inactiveTrackColor: Theme.of(context).colorScheme.primary, // Theme.of(context).colorScheme.onPrimary,
*/ // inactiveTrackColor: Theme.of(context).colorScheme.primary,
), ),
], ],
), ),
@ -153,8 +158,10 @@ class _LeftMenuState extends State<LeftMenu> with PreferencesMixin {
textAlign: TextAlign.center, textAlign: TextAlign.center,
text: TextSpan( text: TextSpan(
style: DefaultTextStyle.of(context).style, style: DefaultTextStyle.of(context).style,
children: <TextSpan>[ children: const <TextSpan>[
TextSpan(text: 'Authors\n', style: TextStyle(fontWeight: FontWeight.bold)), TextSpan(
text: 'Authors\n',
style: TextStyle(fontWeight: FontWeight.bold)),
TextSpan(text: 'Yannick Mauray\n'), TextSpan(text: 'Yannick Mauray\n'),
TextSpan(text: 'Mark Johnson\n'), TextSpan(text: 'Mark Johnson\n'),
TextSpan(text: 'Martin Wimpress\n'), TextSpan(text: 'Martin Wimpress\n'),
@ -165,9 +172,11 @@ class _LeftMenuState extends State<LeftMenu> with PreferencesMixin {
textAlign: TextAlign.center, textAlign: TextAlign.center,
text: TextSpan( text: TextSpan(
style: DefaultTextStyle.of(context).style, style: DefaultTextStyle.of(context).style,
children: <TextSpan>[ children: const <TextSpan>[
TextSpan(text: '© 2021 - 2024\n'), 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)),
], ],
), ),
), ),