From f11119119affc02e8a427dadac434f613669542d Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Tue, 15 Nov 2022 14:32:44 -0700 Subject: [PATCH] changed all settings buttons to PrimaryButton --- .../currency_settings/currency_settings.dart | 108 ++++++++---------- .../language_settings/language_settings.dart | 62 ++++------ .../home/settings_menu/security_settings.dart | 8 +- .../syncing_preferences_settings.dart | 35 ++---- 4 files changed, 79 insertions(+), 134 deletions(-) diff --git a/lib/pages_desktop_specific/home/settings_menu/currency_settings/currency_settings.dart b/lib/pages_desktop_specific/home/settings_menu/currency_settings/currency_settings.dart index b1581d971..7ad8b38b9 100644 --- a/lib/pages_desktop_specific/home/settings_menu/currency_settings/currency_settings.dart +++ b/lib/pages_desktop_specific/home/settings_menu/currency_settings/currency_settings.dart @@ -7,6 +7,7 @@ import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart'; +import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; class CurrencySettings extends ConsumerStatefulWidget { @@ -18,6 +19,41 @@ class CurrencySettings extends ConsumerStatefulWidget { ConsumerState createState() => _CurrencySettings(); } +Future chooseCurrency(BuildContext context) async { + await showDialog( + context: context, + useSafeArea: false, + barrierDismissible: true, + builder: (context) { + return DesktopDialog( + maxHeight: 800, + maxWidth: 600, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.all(32), + child: Text( + "Select currency", + style: STextStyles.desktopH3(context), + textAlign: TextAlign.center, + ), + ), + const DesktopDialogCloseButton(), + ], + ), + const Expanded( + child: BaseCurrencySettingsView(), + ), + ], + ), + ); + }, + ); +} + class _CurrencySettings extends ConsumerState { @override Widget build(BuildContext context) { @@ -65,12 +101,20 @@ class _CurrencySettings extends ConsumerState { ), Column( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ Padding( padding: EdgeInsets.all( 10, ), - child: changeCurrency(), + child: PrimaryButton( + width: 210, + desktopMed: true, + enabled: true, + label: "Change currency", + onPressed: () { + chooseCurrency(context); + }, + ), ), ], ), @@ -82,63 +126,3 @@ class _CurrencySettings extends ConsumerState { ); } } - -class changeCurrency extends ConsumerWidget { - const changeCurrency({ - Key? key, - }) : super(key: key); - Future chooseCurrency(BuildContext context) async { - await showDialog( - context: context, - useSafeArea: false, - barrierDismissible: true, - builder: (context) { - return DesktopDialog( - maxHeight: 800, - maxWidth: 600, - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.all(32), - child: Text( - "Select currency", - style: STextStyles.desktopH3(context), - textAlign: TextAlign.center, - ), - ), - const DesktopDialogCloseButton(), - ], - ), - const Expanded( - child: BaseCurrencySettingsView(), - ), - ], - ), - ); - }, - ); - } - - @override - Widget build(BuildContext context, WidgetRef ref) { - return SizedBox( - width: 200, - height: 48, - child: TextButton( - style: Theme.of(context) - .extension()! - .getPrimaryEnabledButtonColor(context), - onPressed: () { - chooseCurrency(context); - }, - child: Text( - "Change currency", - style: STextStyles.button(context), - ), - ), - ); - } -} diff --git a/lib/pages_desktop_specific/home/settings_menu/language_settings/language_settings.dart b/lib/pages_desktop_specific/home/settings_menu/language_settings/language_settings.dart index 2047d4eff..96ce5cf61 100644 --- a/lib/pages_desktop_specific/home/settings_menu/language_settings/language_settings.dart +++ b/lib/pages_desktop_specific/home/settings_menu/language_settings/language_settings.dart @@ -4,7 +4,7 @@ import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/pages_desktop_specific/home/settings_menu/language_settings/language_dialog.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/text_styles.dart'; -import 'package:stackwallet/utilities/theme/stack_colors.dart'; +import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; class LanguageOptionSettings extends ConsumerStatefulWidget { @@ -17,6 +17,17 @@ class LanguageOptionSettings extends ConsumerStatefulWidget { _LanguageOptionSettings(); } +Future chooseLanguage(BuildContext context) async { + await showDialog( + context: context, + useSafeArea: false, + barrierDismissible: true, + builder: (context) { + return const LanguageDialog(); + }, + ); +} + class _LanguageOptionSettings extends ConsumerState { @override Widget build(BuildContext context) { @@ -66,12 +77,20 @@ class _LanguageOptionSettings extends ConsumerState { ), Column( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ Padding( padding: EdgeInsets.all( 10, ), - child: ChangeLanguageButton(), + child: PrimaryButton( + width: 210, + desktopMed: true, + enabled: true, + label: "Change language", + onPressed: () { + chooseLanguage(context); + }, + ), ), ], ), @@ -83,40 +102,3 @@ class _LanguageOptionSettings extends ConsumerState { ); } } - -class ChangeLanguageButton extends ConsumerWidget { - const ChangeLanguageButton({ - Key? key, - }) : super(key: key); - - Future chooseLanguage(BuildContext context) async { - await showDialog( - context: context, - useSafeArea: false, - barrierDismissible: true, - builder: (context) { - return const LanguageDialog(); - }, - ); - } - - @override - Widget build(BuildContext context, WidgetRef ref) { - return SizedBox( - width: 200, - height: 48, - child: TextButton( - style: Theme.of(context) - .extension()! - .getPrimaryEnabledButtonColor(context), - onPressed: () { - chooseLanguage(context); - }, - child: Text( - "Change language", - style: STextStyles.button(context), - ), - ), - ); - } -} diff --git a/lib/pages_desktop_specific/home/settings_menu/security_settings.dart b/lib/pages_desktop_specific/home/settings_menu/security_settings.dart index 01a6c9c9b..de3505ace 100644 --- a/lib/pages_desktop_specific/home/settings_menu/security_settings.dart +++ b/lib/pages_desktop_specific/home/settings_menu/security_settings.dart @@ -157,20 +157,16 @@ class _SecuritySettings extends ConsumerState { ), ), Padding( - padding: - const EdgeInsets.only(left: 10, right: 10, bottom: 10), + padding: const EdgeInsets.all(10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox( - height: 16, - ), Text( "Change Password", style: STextStyles.desktopTextSmall(context), ), const SizedBox( - height: 8, + height: 16, ), Text( "Protect your Stack Wallet with a strong password. Stack Wallet does not store " diff --git a/lib/pages_desktop_specific/home/settings_menu/syncing_preferences_settings.dart b/lib/pages_desktop_specific/home/settings_menu/syncing_preferences_settings.dart index 618ee56da..b245f8d43 100644 --- a/lib/pages_desktop_specific/home/settings_menu/syncing_preferences_settings.dart +++ b/lib/pages_desktop_specific/home/settings_menu/syncing_preferences_settings.dart @@ -5,7 +5,7 @@ import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/text_styles.dart'; -import 'package:stackwallet/utilities/theme/stack_colors.dart'; +import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; class SyncingPreferencesSettings extends ConsumerStatefulWidget { @@ -75,12 +75,18 @@ class _SyncingPreferencesSettings ), Column( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ Padding( padding: EdgeInsets.all( 10, ), - child: ChangePrefButton(), + child: PrimaryButton( + width: 210, + desktopMed: true, + enabled: true, + label: "Change preferences", + onPressed: () {}, + ), ), ], ), @@ -92,26 +98,3 @@ class _SyncingPreferencesSettings ); } } - -class ChangePrefButton extends ConsumerWidget { - const ChangePrefButton({ - Key? key, - }) : super(key: key); - @override - Widget build(BuildContext context, WidgetRef ref) { - return SizedBox( - width: 200, - height: 48, - child: TextButton( - style: Theme.of(context) - .extension()! - .getPrimaryEnabledButtonColor(context), - onPressed: () {}, - child: Text( - "Change preferences", - style: STextStyles.button(context), - ), - ), - ); - } -}