2020-12-15 19:43:50 +00:00
|
|
|
import 'package:cake_wallet/themes/bright_theme.dart';
|
|
|
|
import 'package:cake_wallet/themes/dark_theme.dart';
|
|
|
|
import 'package:cake_wallet/themes/light_theme.dart';
|
2023-08-17 15:28:31 +00:00
|
|
|
import 'package:cake_wallet/themes/monero_light_theme.dart';
|
|
|
|
import 'package:cake_wallet/themes/monero_dark_theme.dart';
|
|
|
|
import 'package:cake_wallet/themes/matrix_green_theme.dart';
|
|
|
|
import 'package:cake_wallet/themes/bitcoin_dark_theme.dart';
|
|
|
|
import 'package:cake_wallet/themes/bitcoin_light_theme.dart';
|
|
|
|
import 'package:cake_wallet/themes/high_contrast_theme.dart';
|
2020-12-15 19:43:50 +00:00
|
|
|
import 'package:cake_wallet/themes/theme_base.dart';
|
2020-12-15 19:30:16 +00:00
|
|
|
|
|
|
|
class ThemeList {
|
2023-08-17 15:28:31 +00:00
|
|
|
static final all = [
|
|
|
|
brightTheme,
|
|
|
|
lightTheme,
|
|
|
|
darkTheme,
|
|
|
|
moneroDarkTheme,
|
|
|
|
moneroLightTheme,
|
|
|
|
matrixGreenTheme,
|
|
|
|
bitcoinDarkTheme,
|
|
|
|
bitcoinLightTheme,
|
|
|
|
highContrastTheme
|
|
|
|
];
|
2020-12-15 19:30:16 +00:00
|
|
|
|
|
|
|
static final lightTheme = LightTheme(raw: 0);
|
|
|
|
static final brightTheme = BrightTheme(raw: 1);
|
|
|
|
static final darkTheme = DarkTheme(raw: 2);
|
2023-08-17 15:28:31 +00:00
|
|
|
static final moneroDarkTheme = MoneroDarkTheme(raw: 3);
|
|
|
|
static final moneroLightTheme = MoneroLightTheme(raw: 4);
|
|
|
|
static final matrixGreenTheme = MatrixGreenTheme(raw: 5);
|
|
|
|
static final bitcoinDarkTheme = BitcoinDarkTheme(raw: 6);
|
|
|
|
static final bitcoinLightTheme = BitcoinLightTheme(raw: 7);
|
|
|
|
static final highContrastTheme = HighContrastTheme(raw: 8);
|
2020-12-15 19:30:16 +00:00
|
|
|
|
2022-10-12 17:09:57 +00:00
|
|
|
static ThemeBase deserialize({required int raw}) {
|
2020-12-15 19:30:16 +00:00
|
|
|
switch (raw) {
|
|
|
|
case 0:
|
|
|
|
return lightTheme;
|
|
|
|
case 1:
|
|
|
|
return brightTheme;
|
|
|
|
case 2:
|
|
|
|
return darkTheme;
|
2023-08-17 15:28:31 +00:00
|
|
|
case 3:
|
|
|
|
return moneroDarkTheme;
|
|
|
|
case 4:
|
|
|
|
return moneroLightTheme;
|
|
|
|
case 5:
|
|
|
|
return matrixGreenTheme;
|
|
|
|
case 6:
|
|
|
|
return bitcoinDarkTheme;
|
|
|
|
case 7:
|
|
|
|
return bitcoinLightTheme;
|
|
|
|
case 8:
|
|
|
|
return highContrastTheme;
|
2020-12-15 19:30:16 +00:00
|
|
|
default:
|
2023-08-17 15:28:31 +00:00
|
|
|
throw Exception(
|
|
|
|
'Unexpected token raw: $raw for deserialization of ThemeBase');
|
2020-12-15 19:30:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|