From bd80ad4ef434d77b03eecb20793a2744e67e616c Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Mon, 23 Jan 2023 11:16:28 -0700 Subject: [PATCH] add fruit theme button to appearance settings --- .../appearance_settings_view.dart | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart b/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart index b1d9844d6..e48a1bb01 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart @@ -7,6 +7,7 @@ import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/color_theme.dart'; import 'package:stackwallet/utilities/theme/dark_colors.dart'; +import 'package:stackwallet/utilities/theme/fruit_sorbet_theme.dart'; import 'package:stackwallet/utilities/theme/light_colors.dart'; import 'package:stackwallet/utilities/theme/ocean_breeze_colors.dart'; import 'package:stackwallet/utilities/theme/oled_black_colors.dart'; @@ -516,6 +517,87 @@ class _ThemeOptionsView extends ConsumerState { ), ), ), + const SizedBox( + height: 10, + ), + MaterialButton( + splashColor: Colors.transparent, + hoverColor: Colors.transparent, + padding: const EdgeInsets.all(0), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + onPressed: () { + DB.instance.put( + boxName: DB.boxNameTheme, + key: "colorScheme", + value: ThemeType.fruitSorbet.name, + ); + ref.read(colorThemeProvider.state).state = + StackColors.fromStackColorTheme( + FruitSorbetColors(), + ); + + setState(() { + _selectedTheme = "fruitSorbet"; + }); + }, + child: SizedBox( + width: 200, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + SizedBox( + width: 10, + height: 10, + child: Radio( + activeColor: Theme.of(context) + .extension()! + .radioButtonIconEnabled, + value: "fruitSorbet", + groupValue: _selectedTheme, + onChanged: (newValue) { + if (newValue is String && newValue == "fruitSorbet") { + DB.instance.put( + boxName: DB.boxNameTheme, + key: "colorScheme", + value: ThemeType.fruitSorbet.name, + ); + ref.read(colorThemeProvider.state).state = + StackColors.fromStackColorTheme( + OledBlackColors(), + ); + + setState(() { + _selectedTheme = "fruitSorbet"; + }); + } + }, + ), + ), + const SizedBox( + width: 14, + ), + Text( + "Fruit Sorbet", + style: + STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of(context) + .extension()! + .textDark2, + ), + ), + ], + ), + ], + ), + ), + ), ], ); }