changed all settings buttons to PrimaryButton

This commit is contained in:
ryleedavis 2022-11-15 14:32:44 -07:00
parent aead30504e
commit f11119119a
4 changed files with 79 additions and 134 deletions

View file

@ -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<CurrencySettings> createState() => _CurrencySettings();
}
Future<void> chooseCurrency(BuildContext context) async {
await showDialog<dynamic>(
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<CurrencySettings> {
@override
Widget build(BuildContext context) {
@ -65,12 +101,20 @@ class _CurrencySettings extends ConsumerState<CurrencySettings> {
),
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<CurrencySettings> {
);
}
}
class changeCurrency extends ConsumerWidget {
const changeCurrency({
Key? key,
}) : super(key: key);
Future<void> chooseCurrency(BuildContext context) async {
await showDialog<dynamic>(
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<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: () {
chooseCurrency(context);
},
child: Text(
"Change currency",
style: STextStyles.button(context),
),
),
);
}
}

View file

@ -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<void> chooseLanguage(BuildContext context) async {
await showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const LanguageDialog();
},
);
}
class _LanguageOptionSettings extends ConsumerState<LanguageOptionSettings> {
@override
Widget build(BuildContext context) {
@ -66,12 +77,20 @@ class _LanguageOptionSettings extends ConsumerState<LanguageOptionSettings> {
),
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<LanguageOptionSettings> {
);
}
}
class ChangeLanguageButton extends ConsumerWidget {
const ChangeLanguageButton({
Key? key,
}) : super(key: key);
Future<void> chooseLanguage(BuildContext context) async {
await showDialog<dynamic>(
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<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: () {
chooseLanguage(context);
},
child: Text(
"Change language",
style: STextStyles.button(context),
),
),
);
}
}

View file

@ -157,20 +157,16 @@ class _SecuritySettings extends ConsumerState<SecuritySettings> {
),
),
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 "

View file

@ -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<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: () {},
child: Text(
"Change preferences",
style: STextStyles.button(context),
),
),
);
}
}