Skip to content

Commit

Permalink
fix: different dark themes for mobile and desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier committed Aug 31, 2024
1 parent a34d30b commit fe7b369
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/src/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ bool get _isMobile =>
typedef ThemePair = ({ThemeData lightTheme, ThemeData darkTheme});

const _lightBase = Colors.white;
final _darkBase = Colors.black.scale(lightness: 0.04);
final _darkMenuBase = Colors.black.scale(lightness: 0.08);
final _darkBaseDesktop = Colors.black.scale(lightness: 0.09);
final _darkBaseMobile = Colors.black.scale(lightness: 0.04);

final _darkBase = _isMobile ? _darkBaseMobile : _darkBaseDesktop;

final _darkMenuBaseDesktop = Colors.black.scale(lightness: 0.07);
final _darkMenuBaseMobile = Colors.black.scale(lightness: 0.08);
final _darkMenuBase = _isMobile ? _darkMenuBaseMobile : _darkMenuBaseDesktop;

const _kContainerRadius = 10.0;
const _kDesktopButtonHeight = 42.0;
const _kMobileButtonHeight = 48.0;
Expand Down Expand Up @@ -186,7 +193,9 @@ CardTheme _cardTheme(ColorScheme colorScheme) {

Color _cardColor(ColorScheme colorScheme) {
return colorScheme.surface.scale(
lightness: colorScheme.isLight ? -0.06 : 0.08,
lightness: _isMobile
? (colorScheme.isLight ? -0.06 : 0.08)
: (colorScheme.isLight ? -0.06 : 0.05),
);
}

Expand Down

0 comments on commit fe7b369

Please sign in to comment.