refactor button style getter names

This commit is contained in:
julian 2023-01-24 13:29:12 -06:00
parent 9c0992ffbf
commit 028b261dee
64 changed files with 126 additions and 128 deletions

View file

@ -38,10 +38,10 @@ class AddWalletNextButton extends ConsumerWidget {
style: enabled
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
child: Text(
"Next",
style: isDesktop

View file

@ -30,7 +30,7 @@ class CreateWalletButtonGroup extends StatelessWidget {
child: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () {
Navigator.of(context).pushNamed(
NameYourWalletView.routeName,
@ -59,7 +59,7 @@ class CreateWalletButtonGroup extends StatelessWidget {
child: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
onPressed: () {
Navigator.of(context).pushNamed(
NameYourWalletView.routeName,

View file

@ -364,10 +364,10 @@ class _NameYourWalletViewState extends ConsumerState<NameYourWalletView> {
style: _nextEnabled
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
child: Text(
"Next",
style: isDesktop

View file

@ -298,7 +298,7 @@ class _NewWalletRecoveryPhraseViewState
},
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"I saved my recovery phrase",
style: isDesktop

View file

@ -512,10 +512,10 @@ class _NewWalletRecoveryPhraseWarningViewState
style: ref.read(checkBoxStateProvider.state).state
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
child: Text(
"View recovery phrase",
style: isDesktop

View file

@ -23,10 +23,10 @@ class RestoreOptionsNextButton extends StatelessWidget {
style: onPressed != null
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
child: Text(
"Next",
style: STextStyles.button(context),

View file

@ -47,7 +47,7 @@ class _RestoreFailedDialogState extends ConsumerState<RestoreFailedDialog> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Ok",
style: STextStyles.itemSubtitle12(context),

View file

@ -80,7 +80,7 @@ class RestoreSucceededDialog extends StatelessWidget {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Ok",
style: STextStyles.itemSubtitle12(context),

View file

@ -139,7 +139,7 @@ class _RestoringDialogState extends State<RestoringDialog>
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12(context),

View file

@ -331,10 +331,10 @@ class _VerifyRecoveryPhraseViewState
style: selectedWord.isNotEmpty
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
child: isDesktop
? Text(
"Verify",

View file

@ -177,7 +177,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12(context),
@ -189,7 +189,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Delete",
style: STextStyles.button(context),
@ -273,7 +273,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context)!
.getSecondaryEnabledButtonStyle(context)!
.copyWith(
minimumSize: MaterialStateProperty.all<Size>(
const Size(46, 32)),

View file

@ -148,7 +148,7 @@ class ContactPopUp extends ConsumerWidget {
},
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
.getSecondaryEnabledButtonStyle(
context)!
.copyWith(
minimumSize:

View file

@ -135,7 +135,7 @@ class _ConfirmChangeNowSendViewState
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Ok",
style: STextStyles.button(context).copyWith(

View file

@ -136,7 +136,7 @@ class _EditNoteViewState extends ConsumerState<EditTradeNoteView> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Save",
style: STextStyles.button(context),

View file

@ -144,7 +144,6 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
await Future<void>.delayed(const Duration(milliseconds: 300));
Navigator.of(context, rootNavigator: true).pop();
} else {
final toTicker = ref.read(exchangeFormStateProvider).toTicker ?? "";
final fromTicker = ref.read(exchangeFormStateProvider).fromTicker ?? "";
@ -1017,7 +1016,7 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12(context),
@ -1030,7 +1029,7 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Attempt",
style: STextStyles.button(context),

View file

@ -91,7 +91,7 @@ class _ExchangeLoadingOverlayViewState
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"OK",
style: STextStyles.button(context).copyWith(

View file

@ -188,7 +188,7 @@ class _Step1ViewState extends State<Step1View> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Next",
style: STextStyles.button(context),

View file

@ -698,7 +698,7 @@ class _Step2ViewState extends ConsumerState<Step2View> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Back",
style: STextStyles.button(context).copyWith(

View file

@ -208,7 +208,7 @@ class _Step3ViewState extends ConsumerState<Step3View> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Back",
style: STextStyles.button(context).copyWith(
@ -322,7 +322,7 @@ class _Step3ViewState extends ConsumerState<Step3View> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Next",
style: STextStyles.button(context),

View file

@ -426,7 +426,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
Navigator.of(context).pop(),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
.getSecondaryEnabledButtonStyle(
context),
child: Text(
"Cancel",
@ -451,7 +451,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Show QR Code",
style: STextStyles.button(context),
@ -578,7 +578,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
style: Theme.of(context)
.extension<
StackColors>()!
.getSecondaryEnabledButtonColor(
.getSecondaryEnabledButtonStyle(
context),
child: Text(
"Ok",
@ -628,7 +628,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
buttonTitle,
style: STextStyles.button(context).copyWith(

View file

@ -338,7 +338,7 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Ok",
style: STextStyles.button(context).copyWith(

View file

@ -713,7 +713,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
.getSecondaryEnabledButtonStyle(
context),
child: Text(
"Cancel",

View file

@ -45,14 +45,14 @@ class _HomeViewButtonBarState extends ConsumerState<HomeViewButtonBar> {
style: selectedIndex == 0
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)!
.getPrimaryEnabledButtonStyle(context)!
.copyWith(
minimumSize:
MaterialStateProperty.all<Size>(const Size(46, 36)),
)
: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context)!
.getSecondaryEnabledButtonStyle(context)!
.copyWith(
minimumSize:
MaterialStateProperty.all<Size>(const Size(46, 36)),
@ -86,14 +86,14 @@ class _HomeViewButtonBarState extends ConsumerState<HomeViewButtonBar> {
style: selectedIndex == 1
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)!
.getPrimaryEnabledButtonStyle(context)!
.copyWith(
minimumSize:
MaterialStateProperty.all<Size>(const Size(46, 36)),
)
: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context)!
.getSecondaryEnabledButtonStyle(context)!
.copyWith(
minimumSize:
MaterialStateProperty.all<Size>(const Size(46, 36)),

View file

@ -259,7 +259,7 @@ class GetStartedButton extends StatelessWidget {
? TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () {
Prefs.instance.externalCalls = true;
Navigator.of(context).pushNamed(
@ -278,7 +278,7 @@ class GetStartedButton extends StatelessWidget {
child: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () {
Navigator.of(context).pushNamed(
StackPrivacyCalls.routeName,

View file

@ -225,7 +225,7 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,

View file

@ -206,7 +206,7 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
onPressed: generateNewAddress,
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Generate new address",
style: STextStyles.button(context).copyWith(

View file

@ -196,7 +196,7 @@ class _ConfirmTransactionViewState
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Ok",
style: STextStyles.button(context).copyWith(

View file

@ -1608,7 +1608,7 @@ class _SendViewState extends ConsumerState<SendView> {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
.getSecondaryEnabledButtonStyle(
context),
child: Text(
"Cancel",
@ -1628,7 +1628,7 @@ class _SendViewState extends ConsumerState<SendView> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(
.getPrimaryEnabledButtonStyle(
context),
child: Text(
"Yes",
@ -1738,7 +1738,7 @@ class _SendViewState extends ConsumerState<SendView> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
.getSecondaryEnabledButtonStyle(
context),
child: Text(
"Ok",
@ -1767,10 +1767,10 @@ class _SendViewState extends ConsumerState<SendView> {
.state
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
child: Text(
"Preview",
style: STextStyles.button(context),

View file

@ -107,7 +107,7 @@ class _RestoringDialogState extends State<BuildingTransactionDialog>
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12(context),

View file

@ -144,7 +144,7 @@ class _DebugViewState extends ConsumerState<DebugView> {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12(context),
@ -156,7 +156,7 @@ class _DebugViewState extends ConsumerState<DebugView> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Delete logs",
style: STextStyles.button(context),

View file

@ -1,16 +1,15 @@
import 'package:flutter/material.dart';
import 'package:stackwallet/pages/intro_view.dart';
import 'package:stackwallet/utilities/delete_everything.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
import 'package:stackwallet/utilities/delete_everything.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class DeleteAccountView extends StatefulWidget {
const DeleteAccountView({Key? key}) : super(key: key);
@ -35,7 +34,7 @@ class _DeleteAccountViewState extends State<DeleteAccountView> {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
onPressed: () {
Navigator.pop(context);
},
@ -50,7 +49,7 @@ class _DeleteAccountViewState extends State<DeleteAccountView> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () async {
await deleteEverything();

View file

@ -284,7 +284,7 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Save",
style: STextStyles.button(context),
@ -603,10 +603,10 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
style: saveEnabled
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
onPressed: saveEnabled ? attemptSave : null,
child: Text(
"Save",

View file

@ -85,7 +85,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Back",
style: STextStyles.button(context).copyWith(
@ -100,7 +100,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Continue",
style: STextStyles.button(context),
@ -142,7 +142,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Back",
style: STextStyles.button(context).copyWith(
@ -157,7 +157,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Disable",
style: STextStyles.button(context),

View file

@ -483,10 +483,10 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
style: shouldEnableCreate
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
onPressed: !shouldEnableCreate
? null
: () async {

View file

@ -67,7 +67,7 @@ class CreateBackupInfoView extends StatelessWidget {
TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () {
Navigator.of(context)
.pushNamed(CreateBackupView.routeName);

View file

@ -454,10 +454,10 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
style: shouldEnableCreate
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
onPressed: !shouldEnableCreate
? null
: () async {

View file

@ -27,7 +27,7 @@ class CancelStackRestoreDialog extends StatelessWidget {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Back",
style: STextStyles.itemSubtitle12(context),
@ -39,7 +39,7 @@ class CancelStackRestoreDialog extends StatelessWidget {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Yes, cancel",
style: STextStyles.itemSubtitle12(context).copyWith(

View file

@ -781,10 +781,10 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
style: shouldEnableCreate
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
onPressed: !shouldEnableCreate ? null : onSavePressed,
child: Text(
"Save",

View file

@ -158,10 +158,10 @@ class _RestoreFromEncryptedStringViewState
style: passwordController.text.isEmpty
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
onPressed: passwordController.text.isEmpty
? null
: () async {

View file

@ -280,10 +280,10 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
fileLocationController.text.isEmpty
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context)
.getPrimaryDisabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: passwordController.text.isEmpty ||
fileLocationController.text.isEmpty
? null

View file

@ -669,7 +669,7 @@ class _StackRestoreProgressViewState
},
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
_success ? "OK" : "Cancel restore process",
style: STextStyles.button(context).copyWith(

View file

@ -140,7 +140,7 @@ class WalletBackupView extends ConsumerWidget {
TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () {
String data = AddressUtils.encodeQRSeedData(mnemonic);
@ -194,7 +194,7 @@ class WalletBackupView extends ConsumerWidget {
},
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Cancel",
style: STextStyles.button(context).copyWith(

View file

@ -96,7 +96,7 @@ class ConfirmFullRescanDialog extends StatelessWidget {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12(context),
@ -108,7 +108,7 @@ class ConfirmFullRescanDialog extends StatelessWidget {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Rescan",
style: STextStyles.button(context),

View file

@ -126,7 +126,7 @@ class _WalletNetworkSettingsViewState
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Ok",
style: STextStyles.itemSubtitle12(context),
@ -156,7 +156,7 @@ class _WalletNetworkSettingsViewState
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Ok",
style: STextStyles.itemSubtitle12(context),

View file

@ -306,7 +306,7 @@ class _WalletSettingsViewState extends State<WalletSettingsView> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Log out",
style: STextStyles.button(context).copyWith(

View file

@ -156,7 +156,7 @@ class _DeleteWalletRecoveryPhraseViewState
TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () {
showDialog<dynamic>(
barrierDismissible: true,
@ -166,7 +166,7 @@ class _DeleteWalletRecoveryPhraseViewState
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
onPressed: () {
Navigator.pop(context);
},
@ -181,7 +181,7 @@ class _DeleteWalletRecoveryPhraseViewState
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () async {
final walletId = _manager.walletId;
final walletsInstance =

View file

@ -69,7 +69,7 @@ class DeleteWalletWarningView extends ConsumerWidget {
TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
onPressed: () {
Navigator.pop(context);
},
@ -87,7 +87,7 @@ class DeleteWalletWarningView extends ConsumerWidget {
TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () async {
final manager = ref
.read(walletsChangeNotifierProvider)

View file

@ -114,7 +114,7 @@ class _RenameWalletViewState extends ConsumerState<RenameWalletView> {
TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () async {
final newName = _controller.text;
final success = await ref

View file

@ -105,7 +105,7 @@ class WalletSettingsWalletSettingsView extends ConsumerWidget {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
onPressed: () {
Navigator.pop(context);
},
@ -120,7 +120,7 @@ class WalletSettingsWalletSettingsView extends ConsumerWidget {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () {
Navigator.pop(context);
Navigator.push(

View file

@ -204,7 +204,7 @@ class _EditNoteViewState extends ConsumerState<EditNoteView> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Save",
style: STextStyles.button(context),

View file

@ -202,7 +202,7 @@ class _TransactionDetailsViewState
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () {
Navigator.of(context).pop(true);
},

View file

@ -579,7 +579,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
child: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
onPressed: () async {
await showDialog<void>(
context: context,
@ -609,7 +609,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
},
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(
.getPrimaryEnabledButtonStyle(
context),
child: Text(
"Continue",

View file

@ -94,7 +94,7 @@ class AddWalletButton extends StatelessWidget {
return TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: () {
if (isDesktop) {
Navigator.of(

View file

@ -262,10 +262,10 @@ class _DesktopMenuItemState<T> extends ConsumerState<DesktopMenuItem<T>>
style: value == group
? Theme.of(context)
.extension<StackColors>()!
.getDesktopMenuButtonColorSelected(context)
.getDesktopMenuButtonStyleSelected(context)
: Theme.of(context)
.extension<StackColors>()!
.getDesktopMenuButtonColor(context),
.getDesktopMenuButtonStyle(context),
onPressed: () {
onChanged(value);
},

View file

@ -22,7 +22,7 @@ class ExitToMyStackButton extends StatelessWidget {
child: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSmallSecondaryEnabledButtonColor(context),
.getSmallSecondaryEnabledButtonStyle(context),
onPressed: onPressed ??
() {
Navigator.of(context).popUntil(

View file

@ -425,10 +425,10 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
style: nextEnabled
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
onPressed: nextEnabled ? onNextPressed : null,
child: Text(
"Next",

View file

@ -159,7 +159,7 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
leftButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Back",
style: STextStyles.button(context).copyWith(
@ -175,7 +175,7 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Disable",
style: STextStyles.button(context),

View file

@ -25,10 +25,10 @@ class SettingsMenuItem<T> extends StatelessWidget {
style: value == group
? Theme.of(context)
.extension<StackColors>()!
.getDesktopSettingsButtonColor(context)
.getDesktopSettingsButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getDesktopSettingsButtonColor(context),
.getDesktopSettingsButtonStyle(context),
onPressed: () {
onChanged(value);
},

View file

@ -1526,70 +1526,70 @@ class StackColors extends ThemeExtension<StackColors> {
}
}
ButtonStyle? getDeleteEnabledButtonColor(BuildContext context) =>
ButtonStyle? getDeleteEnabledButtonStyle(BuildContext context) =>
Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStateProperty.all<Color>(
textFieldErrorBG,
),
);
ButtonStyle? getDeleteDisabledButtonColor(BuildContext context) =>
ButtonStyle? getDeleteDisabledButtonStyle(BuildContext context) =>
Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStateProperty.all<Color>(
buttonBackSecondaryDisabled,
),
);
ButtonStyle? getPrimaryEnabledButtonColor(BuildContext context) =>
ButtonStyle? getPrimaryEnabledButtonStyle(BuildContext context) =>
Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStateProperty.all<Color>(
buttonBackPrimary,
),
);
ButtonStyle? getPrimaryDisabledButtonColor(BuildContext context) =>
ButtonStyle? getPrimaryDisabledButtonStyle(BuildContext context) =>
Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStateProperty.all<Color>(
buttonBackPrimaryDisabled,
),
);
ButtonStyle? getSecondaryEnabledButtonColor(BuildContext context) =>
ButtonStyle? getSecondaryEnabledButtonStyle(BuildContext context) =>
Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStateProperty.all<Color>(
buttonBackSecondary,
),
);
ButtonStyle? getSecondaryDisabledButtonColor(BuildContext context) =>
ButtonStyle? getSecondaryDisabledButtonStyle(BuildContext context) =>
Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStateProperty.all<Color>(
buttonBackSecondaryDisabled,
),
);
ButtonStyle? getSmallSecondaryEnabledButtonColor(BuildContext context) =>
ButtonStyle? getSmallSecondaryEnabledButtonStyle(BuildContext context) =>
Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStateProperty.all<Color>(
textFieldDefaultBG,
),
);
ButtonStyle? getDesktopMenuButtonColor(BuildContext context) =>
ButtonStyle? getDesktopMenuButtonStyle(BuildContext context) =>
Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStateProperty.all<Color>(
popupBG,
),
);
ButtonStyle? getDesktopMenuButtonColorSelected(BuildContext context) =>
ButtonStyle? getDesktopMenuButtonStyleSelected(BuildContext context) =>
Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStateProperty.all<Color>(
textFieldDefaultBG,
),
);
ButtonStyle? getDesktopSettingsButtonColor(BuildContext context) =>
ButtonStyle? getDesktopSettingsButtonStyle(BuildContext context) =>
Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStateProperty.all<Color>(
background,

View file

@ -64,10 +64,10 @@ class DeleteButton extends StatelessWidget {
style: enabled
? Theme.of(context)
.extension<StackColors>()!
.getDeleteEnabledButtonColor(context)
.getDeleteEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getDeleteDisabledButtonColor(context),
.getDeleteDisabledButtonStyle(context),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View file

@ -136,10 +136,10 @@ class PrimaryButton extends StatelessWidget {
style: enabled
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
.getPrimaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
.getPrimaryDisabledButtonStyle(context),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View file

@ -139,10 +139,10 @@ class SecondaryButton extends StatelessWidget {
style: enabled
? Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context)
.getSecondaryEnabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getSecondaryDisabledButtonColor(context),
.getSecondaryDisabledButtonStyle(context),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View file

@ -307,7 +307,7 @@ class NodeOptionsSheet extends ConsumerWidget {
child: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
.getSecondaryEnabledButtonStyle(context),
onPressed: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(
@ -337,10 +337,10 @@ class NodeOptionsSheet extends ConsumerWidget {
style: status == "Connected"
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context)
.getPrimaryDisabledButtonStyle(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
onPressed: status == "Connected"
? null
: () async {

View file

@ -193,7 +193,7 @@ class StackOkDialog extends StatelessWidget {
},
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
.getPrimaryEnabledButtonStyle(context),
child: Text(
"Ok",
style: STextStyles.button(context),