Add flag to getEnteColorScheme and getEnteTextTheme to get the opposite theme's colors and styles
This commit is contained in:
parent
a56e36a263
commit
6148243157
2 changed files with 17 additions and 4 deletions
|
@ -343,6 +343,9 @@ extension CustomColorScheme on ColorScheme {
|
||||||
|
|
||||||
EnteTheme get enteTheme =>
|
EnteTheme get enteTheme =>
|
||||||
brightness == Brightness.light ? lightTheme : darkTheme;
|
brightness == Brightness.light ? lightTheme : darkTheme;
|
||||||
|
|
||||||
|
EnteTheme get inverseEnteTheme =>
|
||||||
|
brightness == Brightness.light ? darkTheme : lightTheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
OutlinedButtonThemeData buildOutlinedButtonThemeData({
|
OutlinedButtonThemeData buildOutlinedButtonThemeData({
|
||||||
|
|
|
@ -36,10 +36,20 @@ EnteTheme darkTheme = EnteTheme(
|
||||||
shadowButton: shadowButtonDark,
|
shadowButton: shadowButtonDark,
|
||||||
);
|
);
|
||||||
|
|
||||||
EnteColorScheme getEnteColorScheme(BuildContext context) {
|
EnteColorScheme getEnteColorScheme(
|
||||||
return Theme.of(context).colorScheme.enteTheme.colorScheme;
|
BuildContext context, {
|
||||||
|
bool inverse = false,
|
||||||
|
}) {
|
||||||
|
return inverse
|
||||||
|
? Theme.of(context).colorScheme.inverseEnteTheme.colorScheme
|
||||||
|
: Theme.of(context).colorScheme.enteTheme.colorScheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnteTextTheme getEnteTextTheme(BuildContext context) {
|
EnteTextTheme getEnteTextTheme(
|
||||||
return Theme.of(context).colorScheme.enteTheme.textTheme;
|
BuildContext context, {
|
||||||
|
bool inverse = false,
|
||||||
|
}) {
|
||||||
|
return inverse
|
||||||
|
? Theme.of(context).colorScheme.inverseEnteTheme.textTheme
|
||||||
|
: Theme.of(context).colorScheme.enteTheme.textTheme;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue