replace ThemeType enum with themeId Strings

This commit is contained in:
julian 2023-05-09 14:20:29 -06:00
parent 80a23c4bee
commit d182fd2740
18 changed files with 375 additions and 477 deletions

View file

@ -60,7 +60,6 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/prefs.dart';
import 'package:stackwallet/utilities/stack_file_system.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/crypto_notifications.dart';
import 'package:window_size/window_size.dart';
@ -343,25 +342,22 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
@override
void initState() {
StackColorTheme colorTheme;
String themeId;
if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) {
final brightness = WidgetsBinding.instance.window.platformBrightness;
switch (brightness) {
case Brightness.dark:
colorTheme = ref
.read(prefsChangeNotifierProvider)
.systemBrightnessDarkTheme
.colorTheme;
themeId =
ref.read(prefsChangeNotifierProvider).systemBrightnessDarkThemeId;
break;
case Brightness.light:
colorTheme = ref
themeId = ref
.read(prefsChangeNotifierProvider)
.systemBrightnessLightTheme
.colorTheme;
.systemBrightnessLightThemeId;
break;
}
} else {
colorTheme = ref.read(prefsChangeNotifierProvider).theme.colorTheme;
themeId = ref.read(prefsChangeNotifierProvider).themeId;
}
loadingCompleter = Completer();
@ -401,19 +397,16 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
});
WidgetsBinding.instance.window.onPlatformBrightnessChanged = () {
StackColorTheme colorTheme;
String themeId;
switch (WidgetsBinding.instance.window.platformBrightness) {
case Brightness.dark:
colorTheme = ref
.read(prefsChangeNotifierProvider)
.systemBrightnessDarkTheme
.colorTheme;
themeId =
ref.read(prefsChangeNotifierProvider).systemBrightnessDarkThemeId;
break;
case Brightness.light:
colorTheme = ref
themeId = ref
.read(prefsChangeNotifierProvider)
.systemBrightnessLightTheme
.colorTheme;
.systemBrightnessLightThemeId;
break;
}

View file

@ -14,7 +14,7 @@ class StackTheme {
/// id of theme on themes server
@Index(unique: true, replace: true)
final String idOnServer;
final String themeId;
/// the theme name that will be displayed in app
final String name;
@ -1472,7 +1472,7 @@ class StackTheme {
// ===========================================================================
StackTheme({
required this.idOnServer,
required this.themeId,
required this.name,
required this.assets,
required this.brightnessString,
@ -1637,7 +1637,7 @@ class StackTheme {
required String applicationThemesDirectoryPath,
}) {
return StackTheme(
idOnServer: json["id"] as String,
themeId: json["id"] as String,
name: json["name"] as String,
brightnessString: json["brightness"] as String,
backgroundInt: parseColor(json["colors"]["background"] as String),

View file

@ -39,12 +39,12 @@ class _ThemeOptionsWidgetState extends ConsumerState<ThemeOptionsWidget> {
case Brightness.dark:
theme = ref
.read(prefsChangeNotifierProvider.notifier)
.systemBrightnessDarkTheme;
.systemBrightnessDarkThemeId;
break;
case Brightness.light:
theme = ref
.read(prefsChangeNotifierProvider.notifier)
.systemBrightnessLightTheme;
.systemBrightnessLightThemeId;
break;
}
@ -70,7 +70,7 @@ class _ThemeOptionsWidgetState extends ConsumerState<ThemeOptionsWidget> {
final theme = ThemeType.values[index];
// save theme setting
ref.read(prefsChangeNotifierProvider.notifier).theme = theme;
ref.read(prefsChangeNotifierProvider.notifier).themeId = theme;
// apply theme
// ref.read(colorThemeProvider.notifier).state =
@ -88,8 +88,8 @@ class _ThemeOptionsWidgetState extends ConsumerState<ThemeOptionsWidget> {
if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) {
_current = ThemeType.values.length;
} else {
_current =
ThemeType.values.indexOf(ref.read(prefsChangeNotifierProvider).theme);
_current = ThemeType.values
.indexOf(ref.read(prefsChangeNotifierProvider).themeId);
}
super.initState();

View file

@ -24,7 +24,7 @@ class SystemBrightnessThemeSelectionView extends ConsumerWidget {
}) {
final brightness = MediaQuery.of(context).platformBrightness;
if (isDark) {
ref.read(prefsChangeNotifierProvider).systemBrightnessDarkTheme = type;
ref.read(prefsChangeNotifierProvider).systemBrightnessDarkThemeId = type;
if (brightness == Brightness.dark) {
throw Exception("aaaaaaaaaaaaaaaa");
// ref.read(themeProvider.notifier).state =
@ -33,7 +33,7 @@ class SystemBrightnessThemeSelectionView extends ConsumerWidget {
// );
}
} else {
ref.read(prefsChangeNotifierProvider).systemBrightnessLightTheme = type;
ref.read(prefsChangeNotifierProvider).systemBrightnessLightThemeId = type;
if (brightness == Brightness.light) {
throw Exception("aaaaaaaaaaaaaaaa");
// ref.read(colorThemeProvider.notifier).state =
@ -123,7 +123,7 @@ class SystemBrightnessThemeSelectionView extends ConsumerWidget {
ref
.read(
prefsChangeNotifierProvider)
.systemBrightnessLightTheme !=
.systemBrightnessLightThemeId !=
value) {
_setTheme(
context: context,
@ -137,7 +137,7 @@ class SystemBrightnessThemeSelectionView extends ConsumerWidget {
groupValue: ref.watch(
prefsChangeNotifierProvider.select(
(value) => value
.systemBrightnessLightTheme)),
.systemBrightnessLightThemeId)),
),
],
),
@ -181,7 +181,7 @@ class SystemBrightnessThemeSelectionView extends ConsumerWidget {
ref
.read(
prefsChangeNotifierProvider)
.systemBrightnessDarkTheme !=
.systemBrightnessDarkThemeId !=
value) {
_setTheme(
context: context,
@ -195,7 +195,7 @@ class SystemBrightnessThemeSelectionView extends ConsumerWidget {
groupValue: ref.watch(
prefsChangeNotifierProvider.select(
(value) => value
.systemBrightnessDarkTheme)),
.systemBrightnessDarkThemeId)),
),
],
),

View file

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
@ -13,7 +14,6 @@ import 'package:stackwallet/themes/theme_providers.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/conditional_parent.dart';
@ -307,10 +307,11 @@ class _PrivacyToggleState extends ConsumerState<PrivacyToggle> {
@override
Widget build(BuildContext context) {
final bool lightChan =
ref.read(themeProvider.state).state.themeType == ThemeType.chan;
final bool darkChan =
ref.read(themeProvider.state).state.themeType == ThemeType.darkChans;
final easyFile =
ref.watch(themeProvider.select((value) => value.assets.personaEasy));
final incognitoFile = ref
.watch(themeProvider.select((value) => value.assets.personaIncognito));
return Row(
children: [
Expanded(
@ -347,15 +348,15 @@ class _PrivacyToggleState extends ConsumerState<PrivacyToggle> {
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
(lightChan || darkChan)
? Image(
image: AssetImage(Assets.png.chanEasy),
(easyFile.endsWith(".png"))
? Image.file(
File(
easyFile,
),
)
: SvgPicture.asset(
ref.watch(
themeProvider.select(
(value) => value.assets.personaEasy,
),
: SvgPicture.file(
File(
easyFile,
),
width: 140,
height: 140,
@ -456,15 +457,15 @@ class _PrivacyToggleState extends ConsumerState<PrivacyToggle> {
const SizedBox(
height: 10,
),
(lightChan || darkChan)
? Image(
image: AssetImage(Assets.png.chanIncognito),
(incognitoFile.endsWith(".png"))
? Image.file(
File(
incognitoFile,
),
)
: SvgPicture.asset(
ref.watch(
themeProvider.select(
(value) => value.assets.personaIncognito,
),
: SvgPicture.file(
File(
incognitoFile,
),
width: 140,
height: 140,

View file

@ -5,7 +5,6 @@ import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/add_wallet_vi
import 'package:stackwallet/themes/theme_providers.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
@ -17,12 +16,6 @@ class EmptyWallets extends ConsumerWidget {
debugPrint("BUILD: $runtimeType");
final isDesktop = Util.isDesktop;
final bool isSorbet =
ref.read(themeProvider.state).state.themeType == ThemeType.fruitSorbet;
final bool isForest =
ref.read(themeProvider.state).state.themeType == ThemeType.forest;
final bool isOcean =
ref.read(themeProvider.state).state.themeType == ThemeType.oceanBreeze;
return SafeArea(
child: Padding(
@ -41,7 +34,7 @@ class EmptyWallets extends ConsumerWidget {
SvgPicture.asset(
ref.watch(
themeProvider.select(
(value) => value.assets.stack,
(value) => value.assets.stack,
),
),
width: isDesktop ? 324 : MediaQuery.of(context).size.width / 3,
@ -102,8 +95,8 @@ class AddWalletButton extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final bool isOLED =
ref.read(themeProvider.state).state.themeType == ThemeType.oledBlack;
final bool isOLED = ref.watch(themeProvider).themeId == "oled_black";
return TextButton(
style: Theme.of(context)
.extension<StackColors>()!

View file

@ -6,7 +6,6 @@ import 'package:stackwallet/pages/wallets_view/sub_widgets/empty_wallets.dart';
import 'package:stackwallet/pages/wallets_view/sub_widgets/favorite_wallets.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/themes/theme_providers.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
class WalletsView extends ConsumerWidget {
const WalletsView({Key? key}) : super(key: key);
@ -25,9 +24,8 @@ class WalletsView extends ConsumerWidget {
child: hasWallets
? Padding(
padding: EdgeInsets.only(
top: ref.watch(themeProvider).themeType == ThemeType.fruitSorbet
? 6
: 20,
top:
ref.watch(themeProvider).themeId == "fruit_sorbet" ? 6 : 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,

View file

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
@ -11,7 +12,6 @@ import 'package:stackwallet/themes/theme_providers.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
@ -226,10 +226,11 @@ class _PrivacyToggleState extends ConsumerState<PrivacyToggle> {
@override
Widget build(BuildContext context) {
final bool lightChan =
ref.read(themeProvider.state).state.themeType == ThemeType.chan;
final bool darkChan =
ref.read(themeProvider.state).state.themeType == ThemeType.darkChans;
final easyFile =
ref.watch(themeProvider.select((value) => value.assets.personaEasy));
final incognitoFile = ref
.watch(themeProvider.select((value) => value.assets.personaIncognito));
return Row(
children: [
Expanded(
@ -272,19 +273,17 @@ class _PrivacyToggleState extends ConsumerState<PrivacyToggle> {
height: 10,
),
//
(lightChan || darkChan)
? Image(
image: AssetImage(
Assets.png.chanEasy,
(easyFile.endsWith(".png"))
? Image.file(
File(
easyFile,
),
width: 120,
height: 120,
)
: SvgPicture.asset(
ref.watch(
themeProvider.select(
(value) => value.assets.personaEasy,
),
: SvgPicture.file(
File(
easyFile,
),
width: 120,
height: 120,
@ -390,17 +389,17 @@ class _PrivacyToggleState extends ConsumerState<PrivacyToggle> {
const SizedBox(
height: 10,
),
(lightChan || darkChan)
? Image(
image: AssetImage(Assets.png.chanIncognito),
(incognitoFile.endsWith(".png"))
? Image.file(
File(
incognitoFile,
),
width: 120,
height: 120,
)
: SvgPicture.asset(
ref.watch(
themeProvider.select(
(value) => value.assets.personaIncognito,
),
: SvgPicture.file(
File(
incognitoFile,
),
width: 120,
height: 120,

View file

@ -235,7 +235,7 @@ class _ThemeToggle extends ConsumerState<ThemeToggle> {
onTap: () {
if (ref.read(themeProvider.notifier).state.themeType !=
ThemeType.values[i]) {
ref.read(prefsChangeNotifierProvider.notifier).theme =
ref.read(prefsChangeNotifierProvider.notifier).themeId =
ThemeType.values[i];
throw Exception(

View file

@ -4,7 +4,6 @@ import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
import 'package:stackwallet/utilities/enums/languages_enum.dart';
import 'package:stackwallet/utilities/enums/sync_type_enum.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
import 'package:uuid/uuid.dart';
class Prefs extends ChangeNotifier {
@ -44,9 +43,9 @@ class Prefs extends ChangeNotifier {
_signupEpoch = await _getSignupEpoch();
_enableCoinControl = await _getEnableCoinControl();
_enableSystemBrightness = await _getEnableSystemBrightness();
_theme = await _getTheme();
_systemBrightnessLightTheme = await _getSystemBrightnessLightTheme();
_systemBrightnessDarkTheme = await _getSystemBrightnessDarkTheme();
_themeId = await _getThemeId();
_systemBrightnessLightThemeId = await _getSystemBrightnessLightThemeId();
_systemBrightnessDarkThemeId = await _getSystemBrightnessDarkTheme();
_initialized = true;
}
@ -720,72 +719,81 @@ class Prefs extends ChangeNotifier {
false;
}
// system brightness light theme name
// current theme id
ThemeType _theme = ThemeType.light;
String _themeId = "light";
ThemeType get theme => _theme;
String get themeId => _themeId;
set theme(ThemeType theme) {
if (this.theme != theme) {
set themeId(String themeId) {
if (this.themeId != themeId) {
DB.instance.put<dynamic>(
boxName: DB.boxNamePrefs, key: "theme", value: theme.name);
_theme = theme;
boxName: DB.boxNamePrefs,
key: "themeId",
value: themeId,
);
_themeId = themeId;
notifyListeners();
}
}
Future<ThemeType> _getTheme() async {
return ThemeTypeExt.fromName(await DB.instance
.get<dynamic>(boxName: DB.boxNamePrefs, key: "theme") as String? ??
ThemeType.light.name);
}
// system brightness light theme name
ThemeType _systemBrightnessLightTheme = ThemeType.light;
ThemeType get systemBrightnessLightTheme => _systemBrightnessLightTheme;
set systemBrightnessLightTheme(ThemeType systemBrightnessLightTheme) {
if (this.systemBrightnessLightTheme != systemBrightnessLightTheme) {
DB.instance.put<dynamic>(
Future<String> _getThemeId() async {
return await DB.instance.get<dynamic>(
boxName: DB.boxNamePrefs,
key: "systemBrightnessLightTheme",
value: systemBrightnessLightTheme.name);
_systemBrightnessLightTheme = systemBrightnessLightTheme;
notifyListeners();
}
key: "themeId",
) as String? ??
"light";
}
Future<ThemeType> _getSystemBrightnessLightTheme() async {
return ThemeTypeExt.fromName(await DB.instance.get<dynamic>(
boxName: DB.boxNamePrefs,
key: "systemBrightnessLightTheme") as String? ??
ThemeType.light.name);
}
// current system brightness light theme id
// system brightness dark theme name
String _systemBrightnessLightThemeId = "light";
ThemeType _systemBrightnessDarkTheme = ThemeType.dark;
String get systemBrightnessLightThemeId => _systemBrightnessLightThemeId;
ThemeType get systemBrightnessDarkTheme => _systemBrightnessDarkTheme;
set systemBrightnessDarkTheme(ThemeType systemBrightnessDarkTheme) {
if (this.systemBrightnessDarkTheme != systemBrightnessDarkTheme) {
set systemBrightnessLightThemeId(String systemBrightnessLightThemeId) {
if (this.systemBrightnessLightThemeId != systemBrightnessLightThemeId) {
DB.instance.put<dynamic>(
boxName: DB.boxNamePrefs,
key: "systemBrightnessDarkTheme",
value: systemBrightnessDarkTheme.name);
_systemBrightnessDarkTheme = systemBrightnessDarkTheme;
boxName: DB.boxNamePrefs,
key: "systemBrightnessLightThemeId",
value: systemBrightnessLightThemeId,
);
_systemBrightnessLightThemeId = systemBrightnessLightThemeId;
notifyListeners();
}
}
Future<ThemeType> _getSystemBrightnessDarkTheme() async {
return ThemeTypeExt.fromName(await DB.instance.get<dynamic>(
boxName: DB.boxNamePrefs,
key: "systemBrightnessDarkTheme") as String? ??
ThemeType.dark.name);
Future<String> _getSystemBrightnessLightThemeId() async {
return await DB.instance.get<dynamic>(
boxName: DB.boxNamePrefs,
key: "systemBrightnessLightThemeId",
) as String? ??
"light";
}
// current system brightness dark theme id
String _systemBrightnessDarkThemeId = "dark";
String get systemBrightnessDarkThemeId => _systemBrightnessDarkThemeId;
set systemBrightnessDarkThemeId(String systemBrightnessDarkThemeId) {
if (this.systemBrightnessDarkThemeId != systemBrightnessDarkThemeId) {
DB.instance.put<dynamic>(
boxName: DB.boxNamePrefs,
key: "systemBrightnessDarkThemeId",
value: systemBrightnessDarkThemeId,
);
_systemBrightnessDarkThemeId = systemBrightnessDarkThemeId;
notifyListeners();
}
}
Future<String> _getSystemBrightnessDarkTheme() async {
return await DB.instance.get<dynamic>(
boxName: DB.boxNamePrefs,
key: "systemBrightnessDarkThemeId",
) as String? ??
"dark";
}
}

View file

@ -1,304 +1,207 @@
import 'package:flutter/material.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/theme/chan_colors.dart';
import 'package:stackwallet/utilities/theme/dark_colors.dart';
import 'package:stackwallet/utilities/theme/forest_colors.dart';
import 'package:stackwallet/utilities/theme/fruit_sorbet_colors.dart';
import 'package:stackwallet/utilities/theme/light_colors.dart';
import 'package:stackwallet/utilities/theme/ocean_breeze_colors.dart';
import 'package:stackwallet/utilities/theme/oled_black_colors.dart';
import 'package:stackwallet/utilities/theme/oled_chans_colors.dart';
import 'package:stackwallet/utilities/theme/orange_colors.dart';
enum ThemeType {
light,
dark,
oceanBreeze,
oledBlack,
orange,
fruitSorbet,
forest,
chan,
darkChans;
}
// adjust this file
extension ThemeTypeExt on ThemeType {
static ThemeType fromName(String name) {
switch (name) {
case "light":
return ThemeType.light;
case "chan":
return ThemeType.chan;
case "dark":
return ThemeType.dark;
case "oceanBreeze":
return ThemeType.oceanBreeze;
case "oledBlack":
return ThemeType.oledBlack;
case "orange":
return ThemeType.orange;
case "fruitSorbet":
return ThemeType.fruitSorbet;
case "forest":
return ThemeType.forest;
case "darkChans":
return ThemeType.darkChans;
default:
throw ArgumentError("Invalid theme name");
}
}
StackColorTheme get colorTheme {
switch (this) {
case ThemeType.light:
return LightColors();
case ThemeType.chan:
return ChanColors();
case ThemeType.dark:
return DarkColors();
case ThemeType.oceanBreeze:
return OceanBreezeColors();
case ThemeType.oledBlack:
return OledBlackColors();
case ThemeType.orange:
return OrangeColors();
case ThemeType.fruitSorbet:
return FruitSorbetColors();
case ThemeType.forest:
return ForestColors();
case ThemeType.darkChans:
return DarkChansColors();
}
}
String get prettyName {
switch (this) {
case ThemeType.light:
return "Light";
case ThemeType.chan:
return "Crypto Chans";
case ThemeType.dark:
return "Dark";
case ThemeType.oceanBreeze:
return "Ocean Breeze";
case ThemeType.oledBlack:
return "OLED Black";
case ThemeType.orange:
return "Orange";
case ThemeType.fruitSorbet:
return "Fruit Sorbet";
case ThemeType.forest:
return "Forest";
case ThemeType.darkChans:
return "Dark Chans";
}
}
}
abstract class StackColorTheme {
ThemeType get themeType;
Brightness get brightness;
Color get background;
Color get backgroundAppBar;
Gradient? get gradientBackground;
Color get overlay;
Color get accentColorBlue;
Color get accentColorGreen;
Color get accentColorYellow;
Color get accentColorRed;
Color get accentColorOrange;
Color get accentColorDark;
Color get shadow;
Color get textDark;
Color get textDark2;
Color get textDark3;
Color get textSubtitle1;
Color get textSubtitle2;
Color get textSubtitle3;
Color get textSubtitle4;
Color get textSubtitle5;
Color get textSubtitle6;
Color get textWhite;
Color get textFavoriteCard;
Color get textError;
Color get textRestore;
// button background
Color get buttonBackPrimary;
Color get buttonBackSecondary;
Color get buttonBackPrimaryDisabled;
Color get buttonBackSecondaryDisabled;
Color get buttonBackBorder;
Color get buttonBackBorderDisabled;
Color get buttonBackBorderSecondary;
Color get buttonBackBorderSecondaryDisabled;
Color get numberBackDefault;
Color get numpadBackDefault;
Color get bottomNavBack;
// button text/element
Color get buttonTextPrimary;
Color get buttonTextSecondary;
Color get buttonTextPrimaryDisabled;
Color get buttonTextSecondaryDisabled;
Color get buttonTextBorder;
Color get buttonTextDisabled;
Color get buttonTextBorderless;
Color get buttonTextBorderlessDisabled;
Color get numberTextDefault;
Color get numpadTextDefault;
Color get bottomNavText;
Color get customTextButtonEnabledText;
Color get customTextButtonDisabledText;
// switch background
Color get switchBGOn;
Color get switchBGOff;
Color get switchBGDisabled;
// switch circle
Color get switchCircleOn;
Color get switchCircleOff;
Color get switchCircleDisabled;
// step indicator background
Color get stepIndicatorBGCheck;
Color get stepIndicatorBGNumber;
Color get stepIndicatorBGInactive;
Color get stepIndicatorBGLines;
Color get stepIndicatorBGLinesInactive;
Color get stepIndicatorIconText;
Color get stepIndicatorIconNumber;
Color get stepIndicatorIconInactive;
// checkbox
Color get checkboxBGChecked;
Color get checkboxBorderEmpty;
Color get checkboxBGDisabled;
Color get checkboxIconChecked;
Color get checkboxIconDisabled;
Color get checkboxTextLabel;
// snack bar
Color get snackBarBackSuccess;
Color get snackBarBackError;
Color get snackBarBackInfo;
Color get snackBarTextSuccess;
Color get snackBarTextError;
Color get snackBarTextInfo;
// icons
Color get bottomNavIconBack;
Color get bottomNavIconIcon;
Color get topNavIconPrimary;
Color get topNavIconGreen;
Color get topNavIconYellow;
Color get topNavIconRed;
Color get settingsIconBack;
Color get settingsIconIcon;
Color get settingsIconBack2;
Color get settingsIconElement;
// text field
Color get textFieldActiveBG;
Color get textFieldDefaultBG;
Color get textFieldErrorBG;
Color get textFieldSuccessBG;
Color get textFieldErrorBorder;
Color get textFieldSuccessBorder;
Color get textFieldActiveSearchIconLeft;
Color get textFieldDefaultSearchIconLeft;
Color get textFieldErrorSearchIconLeft;
Color get textFieldSuccessSearchIconLeft;
Color get textFieldActiveText;
Color get textFieldDefaultText;
Color get textFieldErrorText;
Color get textFieldSuccessText;
Color get textFieldActiveLabel;
Color get textFieldErrorLabel;
Color get textFieldSuccessLabel;
Color get textFieldActiveSearchIconRight;
Color get textFieldDefaultSearchIconRight;
Color get textFieldErrorSearchIconRight;
Color get textFieldSuccessSearchIconRight;
// settings item level2
Color get settingsItem2ActiveBG;
Color get settingsItem2ActiveText;
Color get settingsItem2ActiveSub;
// radio buttons
Color get radioButtonIconBorder;
Color get radioButtonIconBorderDisabled;
Color get radioButtonBorderEnabled;
Color get radioButtonBorderDisabled;
Color get radioButtonIconCircle;
Color get radioButtonIconEnabled;
Color get radioButtonTextEnabled;
Color get radioButtonTextDisabled;
Color get radioButtonLabelEnabled;
Color get radioButtonLabelDisabled;
// info text
Color get infoItemBG;
Color get infoItemLabel;
Color get infoItemText;
Color get infoItemIcons;
// popup
Color get popupBG;
// currency list
Color get currencyListItemBG;
// bottom nav
Color get stackWalletBG;
Color get stackWalletMid;
Color get stackWalletBottom;
Color get bottomNavShadow;
Color get favoriteStarActive;
Color get favoriteStarInactive;
Color get splash;
Color get highlight;
Color get warningForeground;
Color get warningBackground;
Color get loadingOverlayTextColor;
Color get myStackContactIconBG;
Color get textConfirmTotalAmount;
Color get textSelectedWordTableItem;
// rate type toggle
Color get rateTypeToggleColorOn;
Color get rateTypeToggleColorOff;
Color get rateTypeToggleDesktopColorOn;
Color get rateTypeToggleDesktopColorOff;
// token view colors
Color get ethTagText;
Color get ethTagBG;
Color get ethWalletTagText;
Color get ethWalletTagBG;
Color get tokenSummaryTextPrimary;
Color get tokenSummaryTextSecondary;
Color get tokenSummaryBG;
Color get tokenSummaryButtonBG;
Color get tokenSummaryIcon;
BoxShadow get standardBoxShadow;
BoxShadow? get homeViewButtonBarBoxShadow;
}
// 0xFFFFD8CE
// abstract class StackColorTheme {
// String get themeId;
// Brightness get brightness;
//
// Color get background;
// Color get backgroundAppBar;
//
// Gradient? get gradientBackground;
//
// Color get overlay;
//
// Color get accentColorBlue;
// Color get accentColorGreen;
// Color get accentColorYellow;
// Color get accentColorRed;
// Color get accentColorOrange;
// Color get accentColorDark;
//
// Color get shadow;
//
// Color get textDark;
// Color get textDark2;
// Color get textDark3;
// Color get textSubtitle1;
// Color get textSubtitle2;
// Color get textSubtitle3;
// Color get textSubtitle4;
// Color get textSubtitle5;
// Color get textSubtitle6;
// Color get textWhite;
// Color get textFavoriteCard;
// Color get textError;
// Color get textRestore;
//
// // button background
// Color get buttonBackPrimary;
// Color get buttonBackSecondary;
// Color get buttonBackPrimaryDisabled;
// Color get buttonBackSecondaryDisabled;
// Color get buttonBackBorder;
// Color get buttonBackBorderDisabled;
// Color get buttonBackBorderSecondary;
// Color get buttonBackBorderSecondaryDisabled;
// Color get numberBackDefault;
// Color get numpadBackDefault;
// Color get bottomNavBack;
//
// // button text/element
// Color get buttonTextPrimary;
// Color get buttonTextSecondary;
// Color get buttonTextPrimaryDisabled;
// Color get buttonTextSecondaryDisabled;
// Color get buttonTextBorder;
// Color get buttonTextDisabled;
// Color get buttonTextBorderless;
// Color get buttonTextBorderlessDisabled;
// Color get numberTextDefault;
// Color get numpadTextDefault;
// Color get bottomNavText;
// Color get customTextButtonEnabledText;
// Color get customTextButtonDisabledText;
//
// // switch background
// Color get switchBGOn;
// Color get switchBGOff;
// Color get switchBGDisabled;
//
// // switch circle
// Color get switchCircleOn;
// Color get switchCircleOff;
// Color get switchCircleDisabled;
//
// // step indicator background
// Color get stepIndicatorBGCheck;
// Color get stepIndicatorBGNumber;
// Color get stepIndicatorBGInactive;
// Color get stepIndicatorBGLines;
// Color get stepIndicatorBGLinesInactive;
// Color get stepIndicatorIconText;
// Color get stepIndicatorIconNumber;
// Color get stepIndicatorIconInactive;
//
// // checkbox
// Color get checkboxBGChecked;
// Color get checkboxBorderEmpty;
// Color get checkboxBGDisabled;
// Color get checkboxIconChecked;
// Color get checkboxIconDisabled;
// Color get checkboxTextLabel;
//
// // snack bar
// Color get snackBarBackSuccess;
// Color get snackBarBackError;
// Color get snackBarBackInfo;
// Color get snackBarTextSuccess;
// Color get snackBarTextError;
// Color get snackBarTextInfo;
//
// // icons
// Color get bottomNavIconBack;
// Color get bottomNavIconIcon;
// Color get topNavIconPrimary;
// Color get topNavIconGreen;
// Color get topNavIconYellow;
// Color get topNavIconRed;
// Color get settingsIconBack;
// Color get settingsIconIcon;
// Color get settingsIconBack2;
// Color get settingsIconElement;
//
// // text field
// Color get textFieldActiveBG;
// Color get textFieldDefaultBG;
// Color get textFieldErrorBG;
// Color get textFieldSuccessBG;
// Color get textFieldErrorBorder;
// Color get textFieldSuccessBorder;
// Color get textFieldActiveSearchIconLeft;
// Color get textFieldDefaultSearchIconLeft;
// Color get textFieldErrorSearchIconLeft;
// Color get textFieldSuccessSearchIconLeft;
// Color get textFieldActiveText;
// Color get textFieldDefaultText;
// Color get textFieldErrorText;
// Color get textFieldSuccessText;
// Color get textFieldActiveLabel;
// Color get textFieldErrorLabel;
// Color get textFieldSuccessLabel;
// Color get textFieldActiveSearchIconRight;
// Color get textFieldDefaultSearchIconRight;
// Color get textFieldErrorSearchIconRight;
// Color get textFieldSuccessSearchIconRight;
//
// // settings item level2
// Color get settingsItem2ActiveBG;
// Color get settingsItem2ActiveText;
// Color get settingsItem2ActiveSub;
//
// // radio buttons
// Color get radioButtonIconBorder;
// Color get radioButtonIconBorderDisabled;
// Color get radioButtonBorderEnabled;
// Color get radioButtonBorderDisabled;
// Color get radioButtonIconCircle;
// Color get radioButtonIconEnabled;
// Color get radioButtonTextEnabled;
// Color get radioButtonTextDisabled;
// Color get radioButtonLabelEnabled;
// Color get radioButtonLabelDisabled;
//
// // info text
// Color get infoItemBG;
// Color get infoItemLabel;
// Color get infoItemText;
// Color get infoItemIcons;
//
// // popup
// Color get popupBG;
//
// // currency list
// Color get currencyListItemBG;
//
// // bottom nav
// Color get stackWalletBG;
// Color get stackWalletMid;
// Color get stackWalletBottom;
// Color get bottomNavShadow;
//
// Color get favoriteStarActive;
// Color get favoriteStarInactive;
//
// Color get splash;
// Color get highlight;
// Color get warningForeground;
// Color get warningBackground;
//
// Color get loadingOverlayTextColor;
// Color get myStackContactIconBG;
// Color get textConfirmTotalAmount;
// Color get textSelectedWordTableItem;
//
// // rate type toggle
// Color get rateTypeToggleColorOn;
// Color get rateTypeToggleColorOff;
// Color get rateTypeToggleDesktopColorOn;
// Color get rateTypeToggleDesktopColorOff;
//
// // token view colors
// Color get ethTagText;
// Color get ethTagBG;
// Color get ethWalletTagText;
// Color get ethWalletTagBG;
// Color get tokenSummaryTextPrimary;
// Color get tokenSummaryTextSecondary;
// Color get tokenSummaryBG;
// Color get tokenSummaryButtonBG;
// Color get tokenSummaryIcon;
//
// BoxShadow get standardBoxShadow;
// BoxShadow? get homeViewButtonBarBoxShadow;
// }
const kCoinThemeColorDefaults = CoinThemeColorDefault();

View file

@ -362,7 +362,7 @@ class StackColors extends ThemeExtension<StackColors> {
factory StackColors.fromStackColorTheme(StackTheme colorTheme) {
return StackColors(
themeId: colorTheme.idOnServer,
themeId: colorTheme.themeId,
brightness: colorTheme.brightness,
background: colorTheme.background,
backgroundAppBar: colorTheme.backgroundAppBar,

View file

@ -680,12 +680,12 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs {
returnValueForMissingStub: null,
);
@override
_i8.ThemeType get theme => (super.noSuchMethod(
_i8.ThemeType get themeId => (super.noSuchMethod(
Invocation.getter(#theme),
returnValue: _i8.ThemeType.light,
) as _i8.ThemeType);
@override
set theme(_i8.ThemeType? theme) => super.noSuchMethod(
set themeId(_i8.ThemeType? theme) => super.noSuchMethod(
Invocation.setter(
#theme,
theme,
@ -693,12 +693,12 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs {
returnValueForMissingStub: null,
);
@override
_i8.ThemeType get systemBrightnessLightTheme => (super.noSuchMethod(
_i8.ThemeType get systemBrightnessLightThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessLightTheme),
returnValue: _i8.ThemeType.light,
) as _i8.ThemeType);
@override
set systemBrightnessLightTheme(_i8.ThemeType? systemBrightnessLightTheme) =>
set systemBrightnessLightThemeId(_i8.ThemeType? systemBrightnessLightTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessLightTheme,
@ -707,12 +707,12 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs {
returnValueForMissingStub: null,
);
@override
_i8.ThemeType get systemBrightnessDarkTheme => (super.noSuchMethod(
_i8.ThemeType get systemBrightnessDarkThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessDarkTheme),
returnValue: _i8.ThemeType.light,
) as _i8.ThemeType);
@override
set systemBrightnessDarkTheme(_i8.ThemeType? systemBrightnessDarkTheme) =>
set systemBrightnessDarkThemeId(_i8.ThemeType? systemBrightnessDarkTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessDarkTheme,

View file

@ -401,12 +401,12 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
returnValueForMissingStub: null,
);
@override
_i7.ThemeType get theme => (super.noSuchMethod(
_i7.ThemeType get themeId => (super.noSuchMethod(
Invocation.getter(#theme),
returnValue: _i7.ThemeType.light,
) as _i7.ThemeType);
@override
set theme(_i7.ThemeType? theme) => super.noSuchMethod(
set themeId(_i7.ThemeType? theme) => super.noSuchMethod(
Invocation.setter(
#theme,
theme,
@ -414,12 +414,12 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
returnValueForMissingStub: null,
);
@override
_i7.ThemeType get systemBrightnessLightTheme => (super.noSuchMethod(
_i7.ThemeType get systemBrightnessLightThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessLightTheme),
returnValue: _i7.ThemeType.light,
) as _i7.ThemeType);
@override
set systemBrightnessLightTheme(_i7.ThemeType? systemBrightnessLightTheme) =>
set systemBrightnessLightThemeId(_i7.ThemeType? systemBrightnessLightTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessLightTheme,
@ -428,12 +428,12 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
returnValueForMissingStub: null,
);
@override
_i7.ThemeType get systemBrightnessDarkTheme => (super.noSuchMethod(
_i7.ThemeType get systemBrightnessDarkThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessDarkTheme),
returnValue: _i7.ThemeType.light,
) as _i7.ThemeType);
@override
set systemBrightnessDarkTheme(_i7.ThemeType? systemBrightnessDarkTheme) =>
set systemBrightnessDarkThemeId(_i7.ThemeType? systemBrightnessDarkTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessDarkTheme,

View file

@ -2520,12 +2520,12 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs {
returnValueForMissingStub: null,
);
@override
_i34.ThemeType get theme => (super.noSuchMethod(
_i34.ThemeType get themeId => (super.noSuchMethod(
Invocation.getter(#theme),
returnValue: _i34.ThemeType.light,
) as _i34.ThemeType);
@override
set theme(_i34.ThemeType? theme) => super.noSuchMethod(
set themeId(_i34.ThemeType? theme) => super.noSuchMethod(
Invocation.setter(
#theme,
theme,
@ -2533,12 +2533,13 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs {
returnValueForMissingStub: null,
);
@override
_i34.ThemeType get systemBrightnessLightTheme => (super.noSuchMethod(
_i34.ThemeType get systemBrightnessLightThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessLightTheme),
returnValue: _i34.ThemeType.light,
) as _i34.ThemeType);
@override
set systemBrightnessLightTheme(_i34.ThemeType? systemBrightnessLightTheme) =>
set systemBrightnessLightThemeId(
_i34.ThemeType? systemBrightnessLightTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessLightTheme,
@ -2547,12 +2548,12 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs {
returnValueForMissingStub: null,
);
@override
_i34.ThemeType get systemBrightnessDarkTheme => (super.noSuchMethod(
_i34.ThemeType get systemBrightnessDarkThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessDarkTheme),
returnValue: _i34.ThemeType.light,
) as _i34.ThemeType);
@override
set systemBrightnessDarkTheme(_i34.ThemeType? systemBrightnessDarkTheme) =>
set systemBrightnessDarkThemeId(_i34.ThemeType? systemBrightnessDarkTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessDarkTheme,

View file

@ -351,12 +351,12 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
returnValueForMissingStub: null,
);
@override
_i6.ThemeType get theme => (super.noSuchMethod(
_i6.ThemeType get themeId => (super.noSuchMethod(
Invocation.getter(#theme),
returnValue: _i6.ThemeType.light,
) as _i6.ThemeType);
@override
set theme(_i6.ThemeType? theme) => super.noSuchMethod(
set themeId(_i6.ThemeType? theme) => super.noSuchMethod(
Invocation.setter(
#theme,
theme,
@ -364,12 +364,12 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
returnValueForMissingStub: null,
);
@override
_i6.ThemeType get systemBrightnessLightTheme => (super.noSuchMethod(
_i6.ThemeType get systemBrightnessLightThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessLightTheme),
returnValue: _i6.ThemeType.light,
) as _i6.ThemeType);
@override
set systemBrightnessLightTheme(_i6.ThemeType? systemBrightnessLightTheme) =>
set systemBrightnessLightThemeId(_i6.ThemeType? systemBrightnessLightTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessLightTheme,
@ -378,12 +378,12 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
returnValueForMissingStub: null,
);
@override
_i6.ThemeType get systemBrightnessDarkTheme => (super.noSuchMethod(
_i6.ThemeType get systemBrightnessDarkThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessDarkTheme),
returnValue: _i6.ThemeType.light,
) as _i6.ThemeType);
@override
set systemBrightnessDarkTheme(_i6.ThemeType? systemBrightnessDarkTheme) =>
set systemBrightnessDarkThemeId(_i6.ThemeType? systemBrightnessDarkTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessDarkTheme,

View file

@ -589,12 +589,12 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
returnValueForMissingStub: null,
);
@override
_i16.ThemeType get theme => (super.noSuchMethod(
_i16.ThemeType get themeId => (super.noSuchMethod(
Invocation.getter(#theme),
returnValue: _i16.ThemeType.light,
) as _i16.ThemeType);
@override
set theme(_i16.ThemeType? theme) => super.noSuchMethod(
set themeId(_i16.ThemeType? theme) => super.noSuchMethod(
Invocation.setter(
#theme,
theme,
@ -602,12 +602,13 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
returnValueForMissingStub: null,
);
@override
_i16.ThemeType get systemBrightnessLightTheme => (super.noSuchMethod(
_i16.ThemeType get systemBrightnessLightThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessLightTheme),
returnValue: _i16.ThemeType.light,
) as _i16.ThemeType);
@override
set systemBrightnessLightTheme(_i16.ThemeType? systemBrightnessLightTheme) =>
set systemBrightnessLightThemeId(
_i16.ThemeType? systemBrightnessLightTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessLightTheme,
@ -616,12 +617,12 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
returnValueForMissingStub: null,
);
@override
_i16.ThemeType get systemBrightnessDarkTheme => (super.noSuchMethod(
_i16.ThemeType get systemBrightnessDarkThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessDarkTheme),
returnValue: _i16.ThemeType.light,
) as _i16.ThemeType);
@override
set systemBrightnessDarkTheme(_i16.ThemeType? systemBrightnessDarkTheme) =>
set systemBrightnessDarkThemeId(_i16.ThemeType? systemBrightnessDarkTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessDarkTheme,

View file

@ -2452,12 +2452,12 @@ class MockPrefs extends _i1.Mock implements _i19.Prefs {
returnValueForMissingStub: null,
);
@override
_i27.ThemeType get theme => (super.noSuchMethod(
_i27.ThemeType get themeId => (super.noSuchMethod(
Invocation.getter(#theme),
returnValue: _i27.ThemeType.light,
) as _i27.ThemeType);
@override
set theme(_i27.ThemeType? theme) => super.noSuchMethod(
set themeId(_i27.ThemeType? theme) => super.noSuchMethod(
Invocation.setter(
#theme,
theme,
@ -2465,12 +2465,13 @@ class MockPrefs extends _i1.Mock implements _i19.Prefs {
returnValueForMissingStub: null,
);
@override
_i27.ThemeType get systemBrightnessLightTheme => (super.noSuchMethod(
_i27.ThemeType get systemBrightnessLightThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessLightTheme),
returnValue: _i27.ThemeType.light,
) as _i27.ThemeType);
@override
set systemBrightnessLightTheme(_i27.ThemeType? systemBrightnessLightTheme) =>
set systemBrightnessLightThemeId(
_i27.ThemeType? systemBrightnessLightTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessLightTheme,
@ -2479,12 +2480,12 @@ class MockPrefs extends _i1.Mock implements _i19.Prefs {
returnValueForMissingStub: null,
);
@override
_i27.ThemeType get systemBrightnessDarkTheme => (super.noSuchMethod(
_i27.ThemeType get systemBrightnessDarkThemeId => (super.noSuchMethod(
Invocation.getter(#systemBrightnessDarkTheme),
returnValue: _i27.ThemeType.light,
) as _i27.ThemeType);
@override
set systemBrightnessDarkTheme(_i27.ThemeType? systemBrightnessDarkTheme) =>
set systemBrightnessDarkThemeId(_i27.ThemeType? systemBrightnessDarkTheme) =>
super.noSuchMethod(
Invocation.setter(
#systemBrightnessDarkTheme,