mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-11 13:14:32 +00:00
clean up theme init
This commit is contained in:
parent
18da658a65
commit
c9a91e10ac
1 changed files with 5 additions and 9 deletions
|
@ -318,17 +318,17 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
||||||
final colorScheme = DB.instance
|
final colorScheme = DB.instance
|
||||||
.get<dynamic>(boxName: DB.boxNameTheme, key: "colorScheme") as String?;
|
.get<dynamic>(boxName: DB.boxNameTheme, key: "colorScheme") as String?;
|
||||||
|
|
||||||
ThemeType themeType;
|
StackColorTheme colorTheme;
|
||||||
switch (colorScheme) {
|
switch (colorScheme) {
|
||||||
case "dark":
|
case "dark":
|
||||||
themeType = ThemeType.dark;
|
colorTheme = DarkColors();
|
||||||
break;
|
break;
|
||||||
case "oceanBreeze":
|
case "oceanBreeze":
|
||||||
themeType = ThemeType.oceanBreeze;
|
colorTheme = OceanBreezeColors();
|
||||||
break;
|
break;
|
||||||
case "light":
|
case "light":
|
||||||
default:
|
default:
|
||||||
themeType = ThemeType.light;
|
colorTheme = LightColors();
|
||||||
}
|
}
|
||||||
loadingCompleter = Completer();
|
loadingCompleter = Completer();
|
||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
|
@ -339,11 +339,7 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
ref.read(colorThemeProvider.state).state =
|
ref.read(colorThemeProvider.state).state =
|
||||||
StackColors.fromStackColorTheme(themeType == ThemeType.dark
|
StackColors.fromStackColorTheme(colorTheme);
|
||||||
? DarkColors()
|
|
||||||
: (themeType == ThemeType.light
|
|
||||||
? LightColors()
|
|
||||||
: OceanBreezeColors()));
|
|
||||||
|
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
// fetch open file if it exists
|
// fetch open file if it exists
|
||||||
|
|
Loading…
Reference in a new issue