mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-05 18:29:22 +00:00
WIP testing themes
This commit is contained in:
parent
66f17b2ba1
commit
ec00f6aea4
18 changed files with 127 additions and 118 deletions
|
@ -24,6 +24,7 @@ import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart
|
||||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart';
|
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart';
|
||||||
import 'package:stackwallet/models/exchange/response_objects/trade.dart';
|
import 'package:stackwallet/models/exchange/response_objects/trade.dart';
|
||||||
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||||
|
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||||
import 'package:stackwallet/models/models.dart';
|
import 'package:stackwallet/models/models.dart';
|
||||||
import 'package:stackwallet/models/node_model.dart';
|
import 'package:stackwallet/models/node_model.dart';
|
||||||
import 'package:stackwallet/models/notification_model.dart';
|
import 'package:stackwallet/models/notification_model.dart';
|
||||||
|
@ -41,7 +42,6 @@ import 'package:stackwallet/providers/global/base_currencies_provider.dart';
|
||||||
// import 'package:stackwallet/providers/global/has_authenticated_start_state_provider.dart';
|
// import 'package:stackwallet/providers/global/has_authenticated_start_state_provider.dart';
|
||||||
import 'package:stackwallet/providers/global/trades_service_provider.dart';
|
import 'package:stackwallet/providers/global/trades_service_provider.dart';
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
|
||||||
import 'package:stackwallet/route_generator.dart';
|
import 'package:stackwallet/route_generator.dart';
|
||||||
// import 'package:stackwallet/services/buy/buy_data_loading_service.dart';
|
// import 'package:stackwallet/services/buy/buy_data_loading_service.dart';
|
||||||
import 'package:stackwallet/services/debug_service.dart';
|
import 'package:stackwallet/services/debug_service.dart';
|
||||||
|
@ -51,6 +51,7 @@ import 'package:stackwallet/services/node_service.dart';
|
||||||
import 'package:stackwallet/services/notifications_api.dart';
|
import 'package:stackwallet/services/notifications_api.dart';
|
||||||
import 'package:stackwallet/services/notifications_service.dart';
|
import 'package:stackwallet/services/notifications_service.dart';
|
||||||
import 'package:stackwallet/services/trade_service.dart';
|
import 'package:stackwallet/services/trade_service.dart';
|
||||||
|
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||||
import 'package:stackwallet/themes/theme_providers.dart';
|
import 'package:stackwallet/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/db_version_migration.dart';
|
import 'package:stackwallet/utilities/db_version_migration.dart';
|
||||||
|
@ -60,14 +61,12 @@ import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/utilities/prefs.dart';
|
import 'package:stackwallet/utilities/prefs.dart';
|
||||||
import 'package:stackwallet/utilities/stack_file_system.dart';
|
import 'package:stackwallet/utilities/stack_file_system.dart';
|
||||||
import 'package:stackwallet/utilities/theme/color_theme.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/utilities/util.dart';
|
||||||
import 'package:window_size/window_size.dart';
|
import 'package:window_size/window_size.dart';
|
||||||
|
|
||||||
final openedFromSWBFileStringStateProvider =
|
final openedFromSWBFileStringStateProvider =
|
||||||
StateProvider<String?>((ref) => null);
|
StateProvider<String?>((ref) => null);
|
||||||
|
|
||||||
String? themeDirectory;
|
|
||||||
// main() is the entry point to the app. It initializes Hive (local database),
|
// main() is the entry point to the app. It initializes Hive (local database),
|
||||||
// runs the MyApp widget and checks for new users, caching the value in the
|
// runs the MyApp widget and checks for new users, caching the value in the
|
||||||
// miscellaneous box for later use
|
// miscellaneous box for later use
|
||||||
|
@ -275,9 +274,8 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
||||||
await loadShared();
|
await loadShared();
|
||||||
}
|
}
|
||||||
|
|
||||||
themeDirectory = ref
|
ref.read(applicationThemesDirectoryPathProvider.notifier).state =
|
||||||
.read(applicationThemesDirectoryPathProvider.notifier)
|
(await StackFileSystem.applicationThemesDirectory()).path;
|
||||||
.state = (await StackFileSystem.applicationThemesDirectory()).path;
|
|
||||||
|
|
||||||
_notificationsService = ref.read(notificationsProvider);
|
_notificationsService = ref.read(notificationsProvider);
|
||||||
_nodeService = ref.read(nodeServiceChangeNotifierProvider);
|
_nodeService = ref.read(nodeServiceChangeNotifierProvider);
|
||||||
|
@ -372,8 +370,12 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
||||||
.loadLocale(notify: false);
|
.loadLocale(notify: false);
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
ref.read(colorThemeProvider.state).state =
|
ref.read(themeProvider.state).state = StackTheme.fromJson(
|
||||||
StackColors.fromStackColorTheme(colorTheme);
|
json: darkJson,
|
||||||
|
applicationThemesDirectoryPath: ref.read(
|
||||||
|
applicationThemesDirectoryPathProvider,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
// fetch open file if it exists
|
// fetch open file if it exists
|
||||||
|
@ -411,8 +413,12 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) {
|
if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) {
|
||||||
ref.read(colorThemeProvider.notifier).state =
|
ref.read(themeProvider.state).state = StackTheme.fromJson(
|
||||||
StackColors.fromStackColorTheme(colorTheme);
|
json: darkJson,
|
||||||
|
applicationThemesDirectoryPath: ref.read(
|
||||||
|
applicationThemesDirectoryPathProvider,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -547,7 +553,7 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
||||||
// addToDebugMessagesDB: false);
|
// addToDebugMessagesDB: false);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
final colorScheme = ref.watch(colorThemeProvider.state).state;
|
final colorScheme = ref.watch(colorProvider.state).state;
|
||||||
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
key: GlobalKey(),
|
key: GlobalKey(),
|
||||||
|
|
|
@ -72,14 +72,34 @@ class StackTheme {
|
||||||
// ==== boxShadows =====================================================
|
// ==== boxShadows =====================================================
|
||||||
|
|
||||||
@ignore
|
@ignore
|
||||||
BoxShadow get boxShadows => _boxShadows ??= BoxShadowExt.fromJson(
|
BoxShadow get standardBoxShadow =>
|
||||||
|
_standardBoxShadow ??= BoxShadowExt.fromJson(
|
||||||
Map<String, dynamic>.from(
|
Map<String, dynamic>.from(
|
||||||
jsonDecode(boxShadowsString) as Map,
|
jsonDecode(standardBoxShadowString) as Map,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ignore
|
@ignore
|
||||||
BoxShadow? _boxShadows;
|
BoxShadow? _standardBoxShadow;
|
||||||
final String boxShadowsString;
|
final String standardBoxShadowString;
|
||||||
|
|
||||||
|
@ignore
|
||||||
|
BoxShadow? get homeViewButtonBarBoxShadow {
|
||||||
|
if (homeViewButtonBarBoxShadowString == null) {
|
||||||
|
_homeViewButtonBarBoxShadow = null;
|
||||||
|
} else {
|
||||||
|
_homeViewButtonBarBoxShadow ??= BoxShadowExt.fromJson(
|
||||||
|
Map<String, dynamic>.from(
|
||||||
|
jsonDecode(homeViewButtonBarBoxShadowString!) as Map,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _homeViewButtonBarBoxShadow;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ignore
|
||||||
|
BoxShadow? _homeViewButtonBarBoxShadow;
|
||||||
|
final String? homeViewButtonBarBoxShadowString;
|
||||||
|
|
||||||
// ==== overlay =====================================================
|
// ==== overlay =====================================================
|
||||||
|
|
||||||
|
@ -1456,7 +1476,8 @@ class StackTheme {
|
||||||
required this.backgroundInt,
|
required this.backgroundInt,
|
||||||
required this.backgroundAppBarInt,
|
required this.backgroundAppBarInt,
|
||||||
required this.gradientBackgroundString,
|
required this.gradientBackgroundString,
|
||||||
required this.boxShadowsString,
|
required this.standardBoxShadowString,
|
||||||
|
required this.homeViewButtonBarBoxShadowString,
|
||||||
required this.overlayInt,
|
required this.overlayInt,
|
||||||
required this.accentColorBlueInt,
|
required this.accentColorBlueInt,
|
||||||
required this.accentColorGreenInt,
|
required this.accentColorGreenInt,
|
||||||
|
@ -1624,7 +1645,12 @@ class StackTheme {
|
||||||
json["colors"]["background_colors"]["backgroundAppBar"] as String),
|
json["colors"]["background_colors"]["backgroundAppBar"] as String),
|
||||||
gradientBackgroundString:
|
gradientBackgroundString:
|
||||||
jsonEncode(json["gradients"]["background"] as Map),
|
jsonEncode(json["gradients"]["background"] as Map),
|
||||||
boxShadowsString: jsonEncode(json["box_shadows"] as Map),
|
standardBoxShadowString:
|
||||||
|
jsonEncode(json["box_shadows"]["standard"] as Map),
|
||||||
|
homeViewButtonBarBoxShadowString:
|
||||||
|
json["box_shadows"]["home_view_button_bar"] == null
|
||||||
|
? null
|
||||||
|
: jsonEncode(json["box_shadows"]["home_view_button_bar"] as Map),
|
||||||
coinColorsJsonString: jsonEncode(json["coinColors"] as Map),
|
coinColorsJsonString: jsonEncode(json["coinColors"] as Map),
|
||||||
assets: ThemeAssets.fromJson(
|
assets: ThemeAssets.fromJson(
|
||||||
json: json,
|
json: json,
|
||||||
|
|
|
@ -12,8 +12,8 @@ import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_o
|
||||||
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart';
|
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart';
|
||||||
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart';
|
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart';
|
||||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart';
|
import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
|
||||||
import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart';
|
import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart';
|
||||||
|
import 'package:stackwallet/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
|
@ -67,7 +67,7 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
baseColor = ref.read(colorThemeProvider.state).state.textSubtitle2;
|
baseColor = ref.read(themeProvider.state).state.textSubtitle2;
|
||||||
walletName = widget.walletName;
|
walletName = widget.walletName;
|
||||||
coin = widget.coin;
|
coin = widget.coin;
|
||||||
isDesktop = Util.isDesktop;
|
isDesktop = Util.isDesktop;
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_option.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_option.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/system_brightness_theme_selection_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/system_brightness_theme_selection_view.dart';
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
|
@ -51,10 +50,12 @@ class _ThemeOptionsWidgetState extends ConsumerState<ThemeOptionsWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply theme
|
// apply theme
|
||||||
ref.read(colorThemeProvider.notifier).state =
|
|
||||||
StackColors.fromStackColorTheme(
|
throw Exception("bbbbbbbbbbbbbbbbb");
|
||||||
theme.colorTheme,
|
// ref.read(colorThemeProvider.notifier).state =
|
||||||
);
|
// StackColors.fromStackColorTheme(
|
||||||
|
// theme.colorTheme,
|
||||||
|
// );
|
||||||
|
|
||||||
Assets.precache(context);
|
Assets.precache(context);
|
||||||
} else {
|
} else {
|
||||||
|
@ -73,11 +74,12 @@ class _ThemeOptionsWidgetState extends ConsumerState<ThemeOptionsWidget> {
|
||||||
ref.read(prefsChangeNotifierProvider.notifier).theme = theme;
|
ref.read(prefsChangeNotifierProvider.notifier).theme = theme;
|
||||||
|
|
||||||
// apply theme
|
// apply theme
|
||||||
ref.read(colorThemeProvider.notifier).state =
|
// ref.read(colorThemeProvider.notifier).state =
|
||||||
StackColors.fromStackColorTheme(
|
// StackColors.fromStackColorTheme(
|
||||||
theme.colorTheme,
|
// theme.colorTheme,
|
||||||
);
|
// );
|
||||||
|
|
||||||
|
throw Exception("bbbbbbbbbbbbbbbbb");
|
||||||
Assets.precache(context);
|
Assets.precache(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_option.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/appearance_settings/sub_widgets/theme_option.dart';
|
||||||
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
|
@ -27,18 +26,20 @@ class SystemBrightnessThemeSelectionView extends ConsumerWidget {
|
||||||
if (isDark) {
|
if (isDark) {
|
||||||
ref.read(prefsChangeNotifierProvider).systemBrightnessDarkTheme = type;
|
ref.read(prefsChangeNotifierProvider).systemBrightnessDarkTheme = type;
|
||||||
if (brightness == Brightness.dark) {
|
if (brightness == Brightness.dark) {
|
||||||
ref.read(colorThemeProvider.notifier).state =
|
throw Exception("aaaaaaaaaaaaaaaa");
|
||||||
StackColors.fromStackColorTheme(
|
// ref.read(themeProvider.notifier).state =
|
||||||
type.colorTheme,
|
// StackColors.fromStackColorTheme(
|
||||||
);
|
// type.colorTheme,
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ref.read(prefsChangeNotifierProvider).systemBrightnessLightTheme = type;
|
ref.read(prefsChangeNotifierProvider).systemBrightnessLightTheme = type;
|
||||||
if (brightness == Brightness.light) {
|
if (brightness == Brightness.light) {
|
||||||
ref.read(colorThemeProvider.notifier).state =
|
throw Exception("aaaaaaaaaaaaaaaa");
|
||||||
StackColors.fromStackColorTheme(
|
// ref.read(colorThemeProvider.notifier).state =
|
||||||
type.colorTheme,
|
// StackColors.fromStackColorTheme(
|
||||||
);
|
// type.colorTheme,
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ import 'package:stackwallet/pages/pinpad_views/create_pin_view.dart';
|
||||||
import 'package:stackwallet/pages_desktop_specific/password/create_password_view.dart';
|
import 'package:stackwallet/pages_desktop_specific/password/create_password_view.dart';
|
||||||
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
||||||
import 'package:stackwallet/providers/global/price_provider.dart';
|
import 'package:stackwallet/providers/global/price_provider.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
|
||||||
import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart';
|
import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart';
|
||||||
|
import 'package:stackwallet/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
|
@ -311,9 +311,9 @@ class _PrivacyToggleState extends ConsumerState<PrivacyToggle> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final bool lightChan =
|
final bool lightChan =
|
||||||
ref.read(colorThemeProvider.state).state.themeType == ThemeType.chan;
|
ref.read(themeProvider.state).state.themeType == ThemeType.chan;
|
||||||
final bool darkChan = ref.read(colorThemeProvider.state).state.themeType ==
|
final bool darkChan =
|
||||||
ThemeType.darkChans;
|
ref.read(themeProvider.state).state.themeType == ThemeType.darkChans;
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
|
@ -6,8 +6,8 @@ import 'package:flutter_rounded_date_picker/flutter_rounded_date_picker.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/models/transaction_filter.dart';
|
import 'package:stackwallet/models/transaction_filter.dart';
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
|
||||||
import 'package:stackwallet/providers/ui/transaction_filter_provider.dart';
|
import 'package:stackwallet/providers/ui/transaction_filter_provider.dart';
|
||||||
|
import 'package:stackwallet/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
|
@ -61,7 +61,7 @@ class _TransactionSearchViewState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
initState() {
|
initState() {
|
||||||
baseColor = ref.read(colorThemeProvider.state).state.textSubtitle2;
|
baseColor = ref.read(themeProvider.state).state.textSubtitle2;
|
||||||
final filterState = ref.read(transactionFilterProvider.state).state;
|
final filterState = ref.read(transactionFilterProvider.state).state;
|
||||||
if (filterState != null) {
|
if (filterState != null) {
|
||||||
_isActiveReceivedCheckbox = filterState.received;
|
_isActiveReceivedCheckbox = filterState.received;
|
||||||
|
|
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart';
|
import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
import 'package:stackwallet/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
||||||
|
@ -17,12 +17,12 @@ class EmptyWallets extends ConsumerWidget {
|
||||||
debugPrint("BUILD: $runtimeType");
|
debugPrint("BUILD: $runtimeType");
|
||||||
|
|
||||||
final isDesktop = Util.isDesktop;
|
final isDesktop = Util.isDesktop;
|
||||||
final bool isSorbet = ref.read(colorThemeProvider.state).state.themeType ==
|
final bool isSorbet =
|
||||||
ThemeType.fruitSorbet;
|
ref.read(themeProvider.state).state.themeType == ThemeType.fruitSorbet;
|
||||||
final bool isForest =
|
final bool isForest =
|
||||||
ref.read(colorThemeProvider.state).state.themeType == ThemeType.forest;
|
ref.read(themeProvider.state).state.themeType == ThemeType.forest;
|
||||||
final bool isOcean = ref.read(colorThemeProvider.state).state.themeType ==
|
final bool isOcean =
|
||||||
ThemeType.oceanBreeze;
|
ref.read(themeProvider.state).state.themeType == ThemeType.oceanBreeze;
|
||||||
|
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
@ -98,8 +98,8 @@ class AddWalletButton extends ConsumerWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final bool isOLED = ref.read(colorThemeProvider.state).state.themeType ==
|
final bool isOLED =
|
||||||
ThemeType.oledBlack;
|
ref.read(themeProvider.state).state.themeType == ThemeType.oledBlack;
|
||||||
return TextButton(
|
return TextButton(
|
||||||
style: Theme.of(context)
|
style: Theme.of(context)
|
||||||
.extension<StackColors>()!
|
.extension<StackColors>()!
|
||||||
|
|
|
@ -5,7 +5,7 @@ import 'package:stackwallet/pages/wallets_view/sub_widgets/all_wallets.dart';
|
||||||
import 'package:stackwallet/pages/wallets_view/sub_widgets/empty_wallets.dart';
|
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/pages/wallets_view/sub_widgets/favorite_wallets.dart';
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
import 'package:stackwallet/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
||||||
|
|
||||||
class WalletsView extends ConsumerWidget {
|
class WalletsView extends ConsumerWidget {
|
||||||
|
@ -25,8 +25,7 @@ class WalletsView extends ConsumerWidget {
|
||||||
child: hasWallets
|
child: hasWallets
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: ref.watch(colorThemeProvider).themeType ==
|
top: ref.watch(themeProvider).themeType == ThemeType.fruitSorbet
|
||||||
ThemeType.fruitSorbet
|
|
||||||
? 6
|
? 6
|
||||||
: 20,
|
: 20,
|
||||||
),
|
),
|
||||||
|
|
|
@ -6,8 +6,8 @@ import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/db/hive/db.dart';
|
import 'package:stackwallet/db/hive/db.dart';
|
||||||
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
||||||
import 'package:stackwallet/providers/global/price_provider.dart';
|
import 'package:stackwallet/providers/global/price_provider.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
|
||||||
import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart';
|
import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart';
|
||||||
|
import 'package:stackwallet/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
|
@ -227,9 +227,9 @@ class _PrivacyToggleState extends ConsumerState<PrivacyToggle> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final bool lightChan =
|
final bool lightChan =
|
||||||
ref.read(colorThemeProvider.state).state.themeType == ThemeType.chan;
|
ref.read(themeProvider.state).state.themeType == ThemeType.chan;
|
||||||
final bool darkChan = ref.read(colorThemeProvider.state).state.themeType ==
|
final bool darkChan =
|
||||||
ThemeType.darkChans;
|
ref.read(themeProvider.state).state.themeType == ThemeType.darkChans;
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
import 'package:stackwallet/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
|
@ -233,14 +233,16 @@ class _ThemeToggle extends ConsumerState<ThemeToggle> {
|
||||||
cursor: SystemMouseCursors.click,
|
cursor: SystemMouseCursors.click,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (ref.read(colorThemeProvider.notifier).state.themeType !=
|
if (ref.read(themeProvider.notifier).state.themeType !=
|
||||||
ThemeType.values[i]) {
|
ThemeType.values[i]) {
|
||||||
ref.read(prefsChangeNotifierProvider.notifier).theme =
|
ref.read(prefsChangeNotifierProvider.notifier).theme =
|
||||||
ThemeType.values[i];
|
ThemeType.values[i];
|
||||||
|
|
||||||
ref.read(colorThemeProvider.notifier).state =
|
throw Exception(
|
||||||
StackColors.fromStackColorTheme(
|
"TODO: set theme here properly once implemented");
|
||||||
ThemeType.values[i].colorTheme);
|
// ref.read(themeProvider.notifier).state =
|
||||||
|
// StackColors.fromStackColorTheme(
|
||||||
|
// ThemeType.values[i].colorTheme);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -254,7 +256,7 @@ class _ThemeToggle extends ConsumerState<ThemeToggle> {
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
width: 2.5,
|
width: 2.5,
|
||||||
color: ref
|
color: ref
|
||||||
.read(colorThemeProvider.notifier)
|
.read(themeProvider.notifier)
|
||||||
.state
|
.state
|
||||||
.themeType ==
|
.themeType ==
|
||||||
ThemeType.values[i]
|
ThemeType.values[i]
|
||||||
|
@ -288,10 +290,8 @@ class _ThemeToggle extends ConsumerState<ThemeToggle> {
|
||||||
.extension<StackColors>()!
|
.extension<StackColors>()!
|
||||||
.radioButtonIconEnabled,
|
.radioButtonIconEnabled,
|
||||||
value: ThemeType.values[i],
|
value: ThemeType.values[i],
|
||||||
groupValue: ref
|
groupValue:
|
||||||
.read(colorThemeProvider.state)
|
ref.read(themeProvider.state).state.themeType,
|
||||||
.state
|
|
||||||
.themeType,
|
|
||||||
onChanged: (_) {},
|
onChanged: (_) {},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
||||||
import 'package:stackwallet/utilities/theme/light_colors.dart';
|
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
|
||||||
|
|
||||||
final colorThemeProvider = StateProvider<StackColors>(
|
|
||||||
(ref) => StackColors.fromStackColorTheme(LightColors()));
|
|
|
@ -189,18 +189,16 @@ final Map<String, dynamic> darkJson = {
|
||||||
"token_summary_button_bg": "0xFFC9D0FF",
|
"token_summary_button_bg": "0xFFC9D0FF",
|
||||||
"token_summary_icon": "0xFF252C78"
|
"token_summary_icon": "0xFF252C78"
|
||||||
},
|
},
|
||||||
"box_shadows": [
|
"box_shadows": {
|
||||||
{
|
"standard": {
|
||||||
"type": "standard",
|
|
||||||
"color": "0x0F2D3132",
|
"color": "0x0F2D3132",
|
||||||
"spread_radius": 3.0,
|
"spread_radius": 3.0,
|
||||||
"blur_radius": 4.0
|
"blur_radius": 4.0
|
||||||
},
|
},
|
||||||
{
|
"home_view_button_bar": {
|
||||||
"type": "home_view_button_bar",
|
|
||||||
"color": "0x0F2D3132",
|
"color": "0x0F2D3132",
|
||||||
"spread_radius": 3.0,
|
"spread_radius": 3.0,
|
||||||
"blur_radius": 4.0
|
"blur_radius": 4.0
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,9 +5,16 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||||
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
|
|
||||||
final applicationThemesDirectoryPathProvider = StateProvider((ref) => "");
|
final applicationThemesDirectoryPathProvider = StateProvider((ref) => "");
|
||||||
|
|
||||||
|
final colorProvider = StateProvider<StackColors>(
|
||||||
|
(ref) => StackColors.fromStackColorTheme(
|
||||||
|
ref.watch(themeProvider.state).state,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
final themeProvider = StateProvider<StackTheme>((ref) {
|
final themeProvider = StateProvider<StackTheme>((ref) {
|
||||||
// Return default if no theme was properly loaded on startup. This should
|
// Return default if no theme was properly loaded on startup. This should
|
||||||
// technically never actually be read but we don't want an optional.
|
// technically never actually be read but we don't want an optional.
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:cw_core/pathForWallet.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:stackwallet/main.dart';
|
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/stack_file_system.dart';
|
|
||||||
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
|
@ -113,9 +108,9 @@ class _SVG {
|
||||||
case ThemeType.darkChans:
|
case ThemeType.darkChans:
|
||||||
// print("THIS THEMES DIRECTORY IS $themeDirectory");
|
// print("THIS THEMES DIRECTORY IS $themeDirectory");
|
||||||
// final themesPath = themesDirectory();
|
// final themesPath = themesDirectory();
|
||||||
// return "assets/svg/themed/${ThemeType.dark.name}";
|
return "assets/svg/themed/${ThemeType.dark.name}";
|
||||||
//TODO - remove, this will be accesses from js
|
// //TODO - remove, this will be accesses from js
|
||||||
return "$themeDirectory/dark";
|
// return "$themeDirectory/dark";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "assets/svg/themed/${Theme.of(context).extension<StackColors>()!.themeType.name}";
|
return "assets/svg/themed/${Theme.of(context).extension<StackColors>()!.themeType.name}";
|
||||||
|
|
|
@ -30,28 +30,9 @@ final map = {
|
||||||
};
|
};
|
||||||
|
|
||||||
extension BoxShadowExt on BoxShadow {
|
extension BoxShadowExt on BoxShadow {
|
||||||
static BoxShadow fromJson(Map<String, dynamic> json) {
|
static BoxShadow fromJson(Map<String, dynamic> json) => BoxShadow(
|
||||||
switch (json["boxShadowType"] as String) {
|
color: Color(int.parse(json["color"] as String)),
|
||||||
case "standard":
|
|
||||||
final colorStrings = (json["colors"]);
|
|
||||||
return BoxShadow(
|
|
||||||
color: Color(
|
|
||||||
colorStrings as int,
|
|
||||||
),
|
|
||||||
spreadRadius: json["spread_radius"] as double,
|
spreadRadius: json["spread_radius"] as double,
|
||||||
blurRadius: json["blur_radius"] as double,
|
blurRadius: json["blur_radius"] as double,
|
||||||
);
|
);
|
||||||
case "home_view_button_bar":
|
|
||||||
final colorStrings = (json["colors"]);
|
|
||||||
return BoxShadow(
|
|
||||||
color: Color(
|
|
||||||
colorStrings as int,
|
|
||||||
),
|
|
||||||
spreadRadius: json["spread_radius"] as double,
|
|
||||||
blurRadius: json["blur_radius"] as double,
|
|
||||||
);
|
|
||||||
default:
|
|
||||||
throw ArgumentError("Invalid json box shadow: $json");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
||||||
|
|
||||||
|
@ -359,7 +360,7 @@ class StackColors extends ThemeExtension<StackColors> {
|
||||||
required this.tokenSummaryIcon,
|
required this.tokenSummaryIcon,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory StackColors.fromStackColorTheme(StackColorTheme colorTheme) {
|
factory StackColors.fromStackColorTheme(StackTheme colorTheme) {
|
||||||
return StackColors(
|
return StackColors(
|
||||||
themeType: colorTheme.themeType,
|
themeType: colorTheme.themeType,
|
||||||
brightness: colorTheme.brightness,
|
brightness: colorTheme.brightness,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
|
import 'package:stackwallet/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
|
|
||||||
|
@ -37,10 +37,9 @@ class _FavoriteToggleState extends ConsumerState<FavoriteToggle> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
on = widget.on ??
|
on = widget.on ?? ref.read(themeProvider.state).state.favoriteStarActive;
|
||||||
ref.read(colorThemeProvider.state).state.favoriteStarActive;
|
off =
|
||||||
off = widget.off ??
|
widget.off ?? ref.read(themeProvider.state).state.favoriteStarInactive;
|
||||||
ref.read(colorThemeProvider.state).state.favoriteStarInactive;
|
|
||||||
_isActive = widget.initialState;
|
_isActive = widget.initialState;
|
||||||
_color = _isActive ? on : off;
|
_color = _isActive ? on : off;
|
||||||
_onChanged = widget.onChanged;
|
_onChanged = widget.onChanged;
|
||||||
|
|
Loading…
Reference in a new issue