Skip to content

Commit

Permalink
card color
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier committed May 7, 2024
1 parent b3cc45e commit 7ce9dad
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions lib/src/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ThemePair phoenixTheme({
colorScheme: lightScheme,
splashFactory: NoSplash.splashFactory,
dividerColor: _dividerColor(lightScheme),
cardColor: _cardColor(lightScheme),
).copyWith(
menuTheme: _menuTheme(lightScheme),
popupMenuTheme: _popupMenuTheme(lightScheme),
Expand All @@ -36,11 +37,13 @@ ThemePair phoenixTheme({
navigationBarTheme: _naviBarTheme(lightScheme),
appBarTheme: _appBarTheme(lightScheme),
snackBarTheme: _snackBarThemeData(lightScheme),
cardTheme: _cardTheme(lightScheme),
),
darkTheme: ThemeData(
colorScheme: darkScheme,
splashFactory: NoSplash.splashFactory,
dividerColor: _dividerColor(darkScheme),
cardColor: _cardColor(darkScheme),
).copyWith(
menuTheme: _menuTheme(darkScheme),
popupMenuTheme: _popupMenuTheme(darkScheme),
Expand All @@ -54,11 +57,7 @@ ThemePair phoenixTheme({
navigationBarTheme: _naviBarTheme(darkScheme),
appBarTheme: _appBarTheme(darkScheme),
snackBarTheme: _snackBarThemeData(darkScheme),
cardTheme: CardTheme(
color: darkScheme.surface.scale(
lightness: 0.06,
),
),
cardTheme: _cardTheme(darkScheme),
)
);
}
Expand Down Expand Up @@ -121,6 +120,18 @@ DialogTheme _dialogTheme(ColorScheme colorScheme) {
);
}

CardTheme _cardTheme(ColorScheme colorScheme) {
return CardTheme(
color: _cardColor(colorScheme),
);
}

Color _cardColor(ColorScheme colorScheme) {
return colorScheme.surface.scale(
lightness: colorScheme.isLight ? -0.04 : 0.02,
);
}

PopupMenuThemeData _popupMenuTheme(ColorScheme colorScheme) {
final bgColor = colorScheme.isLight ? lightBase : darkMenuBase;
return PopupMenuThemeData(
Expand Down

0 comments on commit 7ce9dad

Please sign in to comment.