mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +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
|
||||
.get<dynamic>(boxName: DB.boxNameTheme, key: "colorScheme") as String?;
|
||||
|
||||
ThemeType themeType;
|
||||
StackColorTheme colorTheme;
|
||||
switch (colorScheme) {
|
||||
case "dark":
|
||||
themeType = ThemeType.dark;
|
||||
colorTheme = DarkColors();
|
||||
break;
|
||||
case "oceanBreeze":
|
||||
themeType = ThemeType.oceanBreeze;
|
||||
colorTheme = OceanBreezeColors();
|
||||
break;
|
||||
case "light":
|
||||
default:
|
||||
themeType = ThemeType.light;
|
||||
colorTheme = LightColors();
|
||||
}
|
||||
loadingCompleter = Completer();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
|
@ -339,11 +339,7 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
|||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
ref.read(colorThemeProvider.state).state =
|
||||
StackColors.fromStackColorTheme(themeType == ThemeType.dark
|
||||
? DarkColors()
|
||||
: (themeType == ThemeType.light
|
||||
? LightColors()
|
||||
: OceanBreezeColors()));
|
||||
StackColors.fromStackColorTheme(colorTheme);
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
// fetch open file if it exists
|
||||
|
|
Loading…
Reference in a new issue