mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
[feat] add theme for snackbar (#2194)
* feat: add default snackbar theme * fix: since FlowyText overrides textTheme, supply color to widget
This commit is contained in:
parent
17feea1219
commit
ae2146f427
@ -210,6 +210,32 @@ class AppearanceSettingsState with _$AppearanceSettingsState {
|
|||||||
? appTheme.lightTheme
|
? appTheme.lightTheme
|
||||||
: appTheme.darkTheme;
|
: appTheme.darkTheme;
|
||||||
|
|
||||||
|
final colorScheme = ColorScheme(
|
||||||
|
brightness: brightness,
|
||||||
|
primary: theme.primary,
|
||||||
|
onPrimary: theme.onPrimary,
|
||||||
|
primaryContainer: theme.main2,
|
||||||
|
onPrimaryContainer: _white,
|
||||||
|
// page title hover color
|
||||||
|
secondary: theme.hoverBG1,
|
||||||
|
onSecondary: theme.shader1,
|
||||||
|
// setting value hover color
|
||||||
|
secondaryContainer: theme.selector,
|
||||||
|
onSecondaryContainer: theme.topbarBg,
|
||||||
|
tertiary: theme.shader7,
|
||||||
|
tertiaryContainer: theme.questionBubbleBG,
|
||||||
|
background: theme.surface,
|
||||||
|
onBackground: theme.text,
|
||||||
|
surface: theme.surface,
|
||||||
|
// text&icon color when it is hovered
|
||||||
|
onSurface: theme.hoverFG,
|
||||||
|
onError: theme.shader7,
|
||||||
|
error: theme.red,
|
||||||
|
outline: theme.shader4,
|
||||||
|
surfaceVariant: theme.sidebarBg,
|
||||||
|
shadow: theme.shadow,
|
||||||
|
);
|
||||||
|
|
||||||
return ThemeData(
|
return ThemeData(
|
||||||
brightness: brightness,
|
brightness: brightness,
|
||||||
textTheme: _getTextTheme(fontFamily: fontFamily, fontColor: theme.text),
|
textTheme: _getTextTheme(fontFamily: fontFamily, fontColor: theme.text),
|
||||||
@ -227,6 +253,10 @@ class AppearanceSettingsState with _$AppearanceSettingsState {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
scaffoldBackgroundColor: theme.surface,
|
scaffoldBackgroundColor: theme.surface,
|
||||||
|
snackBarTheme: SnackBarThemeData(
|
||||||
|
backgroundColor: colorScheme.primary,
|
||||||
|
contentTextStyle: TextStyle(color: colorScheme.onSurface),
|
||||||
|
),
|
||||||
scrollbarTheme: ScrollbarThemeData(
|
scrollbarTheme: ScrollbarThemeData(
|
||||||
thumbColor: MaterialStateProperty.all(theme.shader3),
|
thumbColor: MaterialStateProperty.all(theme.shader3),
|
||||||
thickness: MaterialStateProperty.resolveWith((states) {
|
thickness: MaterialStateProperty.resolveWith((states) {
|
||||||
@ -254,31 +284,7 @@ class AppearanceSettingsState with _$AppearanceSettingsState {
|
|||||||
highlightColor: theme.main1,
|
highlightColor: theme.main1,
|
||||||
indicatorColor: theme.main1,
|
indicatorColor: theme.main1,
|
||||||
cardColor: theme.input,
|
cardColor: theme.input,
|
||||||
colorScheme: ColorScheme(
|
colorScheme: colorScheme,
|
||||||
brightness: brightness,
|
|
||||||
primary: theme.primary,
|
|
||||||
onPrimary: theme.onPrimary,
|
|
||||||
primaryContainer: theme.main2,
|
|
||||||
onPrimaryContainer: _white,
|
|
||||||
// page title hover color
|
|
||||||
secondary: theme.hoverBG1,
|
|
||||||
onSecondary: theme.shader1,
|
|
||||||
// setting value hover color
|
|
||||||
secondaryContainer: theme.selector,
|
|
||||||
onSecondaryContainer: theme.topbarBg,
|
|
||||||
tertiary: theme.shader7,
|
|
||||||
tertiaryContainer: theme.questionBubbleBG,
|
|
||||||
background: theme.surface,
|
|
||||||
onBackground: theme.text,
|
|
||||||
surface: theme.surface,
|
|
||||||
// text&icon color when it is hovered
|
|
||||||
onSurface: theme.hoverFG,
|
|
||||||
onError: theme.shader7,
|
|
||||||
error: theme.red,
|
|
||||||
outline: theme.shader4,
|
|
||||||
surfaceVariant: theme.sidebarBg,
|
|
||||||
shadow: theme.shadow,
|
|
||||||
),
|
|
||||||
extensions: [
|
extensions: [
|
||||||
AFThemeExtension(
|
AFThemeExtension(
|
||||||
warning: theme.yellow,
|
warning: theme.yellow,
|
||||||
|
@ -52,6 +52,7 @@ class SettingsFileLocationCustomzierState
|
|||||||
SnackBar(
|
SnackBar(
|
||||||
content: FlowyText(
|
content: FlowyText(
|
||||||
LocaleKeys.settings_files_pathCopiedSnackbar.tr(),
|
LocaleKeys.settings_files_pathCopiedSnackbar.tr(),
|
||||||
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user