CAKE-182 | applied new color scheme to alert buttons; deleted themes.dart; added theme_base.dart, light_theme.dart, bright_theme.dart, dark_theme.dart, theme_list.dart to the app

This commit is contained in:
OleksandrSobol
2020-12-15 21:30:16 +02:00
parent 85497a1218
commit 10b419fbbe
17 changed files with 675 additions and 650 deletions
+7 -6
View File
@@ -1,5 +1,6 @@
import 'package:cake_wallet/entities/preferences_key.dart';
import 'package:cake_wallet/themes.dart';
import 'package:cake_wallet/src/themes/theme_base.dart';
import 'package:cake_wallet/src/themes/theme_list.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
@@ -28,7 +29,7 @@ abstract class SettingsStoreBase with Store {
@required BalanceDisplayMode initialBalanceDisplayMode,
@required bool initialSaveRecipientAddress,
@required bool initialAllowBiometricalAuthentication,
@required Themes initialTheme,
@required ThemeBase initialTheme,
@required int initialPinLength,
@required String initialLanguageCode,
// @required String initialCurrentLocale,
@@ -66,8 +67,8 @@ abstract class SettingsStoreBase with Store {
reaction(
(_) => currentTheme,
(Themes theme) => sharedPreferences.setInt(
PreferencesKey.currentTheme, theme.serialize()));
(ThemeBase theme) => sharedPreferences.setInt(
PreferencesKey.currentTheme, theme.raw));
reaction(
(_) => allowBiometricalAuthentication,
@@ -111,7 +112,7 @@ abstract class SettingsStoreBase with Store {
bool allowBiometricalAuthentication;
@observable
Themes currentTheme;
ThemeBase currentTheme;
@observable
int pinCodeLength;
@@ -154,7 +155,7 @@ abstract class SettingsStoreBase with Store {
final allowBiometricalAuthentication = sharedPreferences
.getBool(PreferencesKey.allowBiometricalAuthenticationKey) ??
false;
final savedTheme = Themes.deserialize(
final savedTheme = ThemeList.deserialize(
raw: sharedPreferences.getInt(PreferencesKey.currentTheme) ?? 0);
final actionListDisplayMode = ObservableList<ActionListDisplayMode>();
actionListDisplayMode.addAll(deserializeActionlistDisplayModes(