design fix

This commit is contained in:
55nknown 2023-02-27 15:21:35 +01:00
parent a43bf056c9
commit 8f466a9a37
2 changed files with 29 additions and 18 deletions

View File

@ -9,7 +9,7 @@ import 'package:flutter/material.dart';
class AppColors { class AppColors {
static ThemeAppColors of(BuildContext context) => fromBrightness(Theme.of(context).brightness); static ThemeAppColors of(BuildContext context) => fromBrightness(Theme.of(context).brightness);
static fromBrightness(Brightness brightness) { static ThemeAppColors fromBrightness(Brightness brightness) {
if (Platform.isAndroid || Platform.isIOS) { if (Platform.isAndroid || Platform.isIOS) {
switch (brightness) { switch (brightness) {
case Brightness.light: case Brightness.light:

View File

@ -35,9 +35,9 @@ class AppTheme {
} }
Color backgroundColor = Color backgroundColor =
accentColor == AccentColor.custom ? settings.customBackgroundColor : _paletteBackgroundLight(palette) ?? lightColors.background; (accentColor == AccentColor.custom ? settings.customBackgroundColor : _paletteBackgroundLight(palette)) ?? lightColors.background;
Color highlightColor = Color highlightColor =
accentColor == AccentColor.custom ? settings.customHighlightColor : _paletteHighlightLight(palette) ?? lightColors.highlight; (accentColor == AccentColor.custom ? settings.customHighlightColor : _paletteHighlightLight(palette)) ?? lightColors.highlight;
return ThemeData( return ThemeData(
brightness: Brightness.light, brightness: Brightness.light,
@ -46,15 +46,20 @@ class AppTheme {
scaffoldBackgroundColor: backgroundColor, scaffoldBackgroundColor: backgroundColor,
primaryColor: lightColors.filc, primaryColor: lightColors.filc,
dividerColor: const Color(0x00000000), dividerColor: const Color(0x00000000),
colorScheme: ColorScheme.fromSwatch( colorScheme: ColorScheme(
accentColor: accent, primary: accent,
backgroundColor: highlightColor, onPrimary: (accent.computeLuminance() > 0.5 ? Colors.black : Colors.white).withOpacity(.9),
secondary: accent,
onSecondary: (accent.computeLuminance() > 0.5 ? Colors.black : Colors.white).withOpacity(.9),
background: highlightColor,
onBackground: Colors.black.withOpacity(.9),
brightness: Brightness.light, brightness: Brightness.light,
cardColor: highlightColor, error: lightColors.red,
errorColor: lightColors.red, onError: Colors.white.withOpacity(.9),
primaryColorDark: lightColors.filc, surface: highlightColor,
onSurface: Colors.black.withOpacity(.9),
), ),
shadowColor: highlightColor.withOpacity(.5), //lightColors.shadow, shadowColor: lightColors.shadow.withOpacity(.5),
appBarTheme: AppBarTheme(backgroundColor: backgroundColor), appBarTheme: AppBarTheme(backgroundColor: backgroundColor),
indicatorColor: accent, indicatorColor: accent,
iconTheme: IconThemeData(color: lightColors.text.withOpacity(.75)), iconTheme: IconThemeData(color: lightColors.text.withOpacity(.75)),
@ -97,8 +102,9 @@ class AppTheme {
} }
Color backgroundColor = Color backgroundColor =
accentColor == AccentColor.custom ? settings.customBackgroundColor : _paletteBackgroundDark(palette) ?? darkColors.background; (accentColor == AccentColor.custom ? settings.customBackgroundColor : _paletteBackgroundDark(palette)) ?? darkColors.background;
Color highlightColor = accentColor == AccentColor.custom ? settings.customHighlightColor : _paletteHighlightDark(palette) ?? darkColors.highlight; Color highlightColor =
(accentColor == AccentColor.custom ? settings.customHighlightColor : _paletteHighlightDark(palette)) ?? darkColors.highlight;
return ThemeData( return ThemeData(
brightness: Brightness.dark, brightness: Brightness.dark,
@ -107,13 +113,18 @@ class AppTheme {
scaffoldBackgroundColor: backgroundColor, scaffoldBackgroundColor: backgroundColor,
primaryColor: darkColors.filc, primaryColor: darkColors.filc,
dividerColor: const Color(0x00000000), dividerColor: const Color(0x00000000),
colorScheme: ColorScheme.fromSwatch( colorScheme: ColorScheme(
accentColor: accent, primary: accent,
backgroundColor: highlightColor, onPrimary: (accent.computeLuminance() > 0.5 ? Colors.black : Colors.white).withOpacity(.9),
secondary: accent,
onSecondary: (accent.computeLuminance() > 0.5 ? Colors.black : Colors.white).withOpacity(.9),
background: highlightColor,
onBackground: Colors.white.withOpacity(.9),
brightness: Brightness.dark, brightness: Brightness.dark,
cardColor: highlightColor, error: darkColors.red,
errorColor: darkColors.red, onError: Colors.black.withOpacity(.9),
primaryColorDark: darkColors.filc, surface: highlightColor,
onSurface: Colors.white.withOpacity(.9),
), ),
shadowColor: highlightColor.withOpacity(.5), //darkColors.shadow, shadowColor: highlightColor.withOpacity(.5), //darkColors.shadow,
appBarTheme: AppBarTheme(backgroundColor: backgroundColor), appBarTheme: AppBarTheme(backgroundColor: backgroundColor),