refactor: text themes using the same color as primaryColor

This commit is contained in:
Rafael Saes 2023-07-03 09:32:29 -03:00
parent 3fb1a70cde
commit 2525318b6d
48 changed files with 50 additions and 168 deletions

View file

@ -79,10 +79,7 @@ class BackupPage extends BasePage {
isLoading: backupViewModelBase.state is IsExecutingState,
onPressed: () => onExportBackup(context),
text: S.of(context).export_backup,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white)),
bottom: 24,
left: 24,

View file

@ -48,10 +48,7 @@ class EditBackupPasswordPage extends BasePage {
builder: (_) => PrimaryButton(
onPressed: () => onSave(context),
text: S.of(context).save,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isDisabled: !editBackupPasswordViewModel.canSave)),
bottom: 24,

View file

@ -248,7 +248,7 @@ class PreOrderPage extends BasePage {
? S.of(context).buy
: S.of(context).buy_with +
' ${buyViewModel.selectedProvider!.description.title}',
color: Theme.of(context).accentTextTheme!.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isLoading: buyViewModel.isRunning,
isDisabled: (buyViewModel.selectedProvider == null) ||

View file

@ -143,10 +143,7 @@ class ContactPage extends BasePage {
await contactViewModel.save();
},
text: S.of(context).save,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isDisabled: !contactViewModel.isReady)))
],

View file

@ -243,7 +243,7 @@ class ExchangePage extends BasePage {
}
}
},
color: Theme.of(context).accentTextTheme!.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isDisabled: exchangeViewModel.selectedProviders.isEmpty,
isLoading: exchangeViewModel.tradeState is TradeIsCreating)),

View file

@ -83,10 +83,7 @@ class PickerItemWidget extends StatelessWidget {
),
if (isSelected)
Icon(Icons.check_circle,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!)
color: Theme.of(context).primaryColor)
],
),
),

View file

@ -133,10 +133,7 @@ class ExchangeConfirmPage extends BasePage {
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.exchangeTrade),
text: S.of(context).saved_the_trade_id,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white)
],
),

View file

@ -228,10 +228,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
onPressed: () =>
widget.exchangeTradeViewModel.confirmSending(),
text: S.of(context).confirm,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white)
: Offstage();
})),
@ -360,10 +357,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
RequestReviewHandler.requestReview();
},
text: S.of(popupContext).send_got_it,
color: Theme.of(popupContext)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(popupContext).primaryColor,
textColor: Colors.white))
],
);

View file

@ -84,10 +84,7 @@ class IoniaCreateAccountPage extends BasePage {
onPressed: _createAccount,
isLoading:
_authViewModel.createUserState is IoniaCreateStateLoading,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
),
@ -107,10 +104,7 @@ class IoniaCreateAccountPage extends BasePage {
TextSpan(
text: S.of(context).settings_terms_and_conditions,
style: TextStyle(
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w700,
),
recognizer: TapGestureRecognizer()
@ -122,10 +116,7 @@ class IoniaCreateAccountPage extends BasePage {
TextSpan(
text: S.of(context).privacy_policy,
style: TextStyle(
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w700,
),
recognizer: TapGestureRecognizer()

View file

@ -74,10 +74,7 @@ class IoniaLoginPage extends BasePage {
text: S.of(context).login,
onPressed: _login,
isLoading: _authViewModel.signInState is IoniaCreateStateLoading,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
),

View file

@ -126,10 +126,7 @@ class IoniaVerifyIoniaOtp extends BasePage {
onPressed: _verify,
isDisabled: _authViewModel.otpState is IoniaOtpSendDisabled,
isLoading: _authViewModel.otpState is IoniaOtpValidating,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
),

View file

@ -59,10 +59,7 @@ class IoniaWelcomePage extends BasePage {
PrimaryButton(
text: S.of(context).create_account,
onPressed: () => Navigator.of(context).pushNamed(Routes.ioniaCreateAccountPage),
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
SizedBox(

View file

@ -89,10 +89,7 @@ class _IoniaCardTabsState extends State<_IoniaCardTabs> with SingleTickerProvide
borderRadius: BorderRadius.circular(
25.0,
),
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
),
labelColor: Theme.of(context)
.primaryTextTheme!

View file

@ -136,10 +136,7 @@ class IoniaAccountPage extends BasePage {
bottomSection: Column(
children: [
PrimaryButton(
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
text: S.of(context).logout,
onPressed: () {

View file

@ -79,10 +79,7 @@ class IoniaActivateDebitCardPage extends BasePage {
},
isLoading: _cardsListViewModel.createCardState is IoniaCreateCardLoading,
text: S.of(context).agree_and_continue,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
);

View file

@ -202,7 +202,7 @@ class IoniaBuyGiftCardDetailPage extends BasePage {
ioniaPurchaseViewModel.invoiceCommittingState is IsExecutingState,
onPressed: () => purchaseCard(context),
text: S.of(context).purchase_gift_card,
color: Theme.of(context).accentTextTheme!.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
);
}),
@ -323,7 +323,7 @@ class IoniaBuyGiftCardDetailPage extends BasePage {
alertLeftActionButtonTextColor: Colors.white,
alertRightActionButtonTextColor: Colors.white,
alertLeftActionButtonColor: Palette.brightOrange,
alertRightActionButtonColor: Theme.of(context).textTheme!.titleSmall!.color,
alertRightActionButtonColor: Theme.of(context).primaryColor,
actionRightButton: () async {
Navigator.of(context).pop();
await ioniaPurchaseViewModel.commitPaymentInvoice();

View file

@ -195,10 +195,7 @@ class IoniaBuyGiftCardPage extends BasePage {
),
text: S.of(context).continue_text,
isDisabled: !ioniaBuyCardViewModel.isEnablePurchase,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
);

View file

@ -178,10 +178,7 @@ class IoniaCustomRedeemPage extends BasePage {
isLoading: ioniaCustomRedeemViewModel.redeemState is IsExecutingState,
isDisabled: ioniaCustomRedeemViewModel.disableRedeem,
text: S.of(context).add_custom_redemption,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
onPressed: () => ioniaCustomRedeemViewModel.addCustomRedeem().then((value) {
Navigator.of(context).pop(ioniaCustomRedeemViewModel.remaining.toString());

View file

@ -184,10 +184,7 @@ class IoniaCustomTipPage extends BasePage {
Navigator.of(context).pop(customTipViewModel.customTip);
},
text: S.of(context).add_tip,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
),

View file

@ -73,10 +73,7 @@ class IoniaDebitCardPage extends BasePage {
PrimaryButton(
text: S.of(context).add_value,
onPressed: () {},
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
SizedBox(height: 16)
@ -150,10 +147,7 @@ class IoniaDebitCardPage extends BasePage {
bottomSection: PrimaryButton(
text: S.of(context).activate,
onPressed: () => _showHowToUseCard(context, activate: true),
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
);

View file

@ -158,7 +158,7 @@ class IoniaGiftCardDetailPage extends BasePage {
},
),
text: S.of(context).mark_as_redeemed,
color: Theme.of(context).accentTextTheme!.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
],

View file

@ -175,7 +175,7 @@ class _IoniaPaymentStatusPageBodyBodyState extends State<_IoniaPaymentStatusPage
Routes.ioniaGiftCardDetailPage,
arguments: [widget.viewModel.giftCard]),
text: S.of(context).open_gift_card,
color: Theme.of(context).accentTextTheme!.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white);
}

View file

@ -20,7 +20,7 @@ class IoniaFilterModal extends StatelessWidget {
padding: EdgeInsets.all(10),
child: Image.asset(
'assets/images/mini_search_icon.png',
color: Theme.of(context).textTheme!.titleSmall!.color!,
color: Theme.of(context).primaryColor,
),
);
return Scaffold(

View file

@ -15,7 +15,7 @@ class RoundedCheckbox extends StatelessWidget {
width: 20.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(50.0)),
color: Theme.of(context).accentTextTheme!.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
),
child: Icon(
Icons.check,

View file

@ -56,7 +56,7 @@ class MoneroAccountEditOrCreatePage extends BasePage {
text: moneroAccountCreationViewModel.isEdit
? S.of(context).rename
: S.of(context).add,
color: Theme.of(context).accentTextTheme!.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isLoading: moneroAccountCreationViewModel.state
is IsExecutingState,

View file

@ -128,7 +128,7 @@ class MoneroAccountListPage extends StatelessWidget {
.pushNamed(Routes.accountCreation),
child: Container(
height: 62,
color: Theme.of(context).cardColor,
color: Theme.of(context).primaryColor,
padding: EdgeInsets.only(left: 24, right: 24),
child: Center(
child: Row(

View file

@ -23,7 +23,7 @@ class AccountTile extends StatelessWidget {
? Theme.of(context).textTheme!.titleSmall!.decorationColor!
: Theme.of(context).textTheme!.displayLarge!.decorationColor!;
final textColor = isCurrent
? Theme.of(context).textTheme!.titleSmall!.color!
? Theme.of(context).primaryColor
: Theme.of(context).textTheme!.displayLarge!.color!;
final Widget cell = GestureDetector(

View file

@ -111,10 +111,7 @@ class _AdvancedPrivacySettingsBodyState extends State<AdvancedPrivacySettingsBod
Navigator.pop(context);
},
text: S.of(context).continue_text,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
const SizedBox(height: 25),

View file

@ -102,10 +102,7 @@ class WalletTypeFormState extends State<WalletTypeForm> {
bottomSection: PrimaryButton(
onPressed: () => onTypeSelected(),
text: S.of(context).seed_language_next,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isDisabled: selected == null,
),

View file

@ -148,10 +148,7 @@ class NodeCreateOrEditPage extends BasePage {
Navigator.of(context).pop();
},
text: S.of(context).save,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isDisabled: (!nodeCreateOrEditViewModel.isReady)||
(nodeCreateOrEditViewModel

View file

@ -176,10 +176,7 @@ class AnonPayInvoicePage extends BasePage {
anonInvoicePageViewModel.generateDonationLink();
}
},
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isLoading: anonInvoicePageViewModel.state is IsExecutingState,
),

View file

@ -35,10 +35,7 @@ class RescanPage extends BasePage {
_blockchainHeightWidgetKey.currentState!.height);
Navigator.of(context).pop();
},
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isDisabled: !_rescanViewModel.isButtonEnabled,
))

View file

@ -75,10 +75,7 @@ class RestoreFromBackupPage extends BasePage {
restoreFromBackupViewModel.state is IsExecutingState,
onPressed: () => onImportHandler(context),
text: S.of(context).import,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white);
}))
])),

View file

@ -134,10 +134,7 @@ class _RestoreFromSeedDetailsFormState
isLoading:
widget.walletRestorationFromSeedVM.state is IsExecutingState,
text: S.of(context).restore_recover,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isDisabled: _nameController.text.isNotEmpty,
);

View file

@ -70,10 +70,7 @@ class PreSeedPage extends BasePage {
onPressed: () => Navigator.of(context)
.popAndPushNamed(Routes.seed, arguments: true),
text: S.of(context).pre_seed_button_text,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white)
],
))

View file

@ -375,7 +375,7 @@ class SendPage extends BasePage {
},
text: S.of(context).send,
color:
Theme.of(context).accentTextTheme!.bodyLarge!.color!,
Theme.of(context).primaryColor,
textColor: Colors.white,
isLoading: sendViewModel.state is IsExecutingState ||
sendViewModel.state is TransactionCommitting,

View file

@ -52,10 +52,7 @@ class SettingsChoicesCell extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: isSelected
? Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!
? Theme.of(context).primaryColor
: null,
),
child: Text(

View file

@ -190,7 +190,7 @@ class TOTPEnterCode extends BasePage {
);
},
text: S.of(context).continue_text,
color: Theme.of(context).accentTextTheme.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
);
},

View file

@ -134,7 +134,7 @@ class Setup2FAQRPage extends BasePage {
);
},
text: S.current.continue_text,
color: Theme.of(context).accentTextTheme.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
SizedBox(height: 24),

View file

@ -53,10 +53,7 @@ class AddressEditOrCreatePage extends BasePage {
text: addressEditOrCreateViewModel.isEdit
? S.of(context).rename
: S.of(context).new_subaddress_create,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isLoading:
addressEditOrCreateViewModel.state is AddressIsSaving,

View file

@ -171,7 +171,7 @@ class WalletListBodyState extends State<WalletListBody> {
},
image: newWalletImage,
text: S.of(context).wallet_list_create_new_wallet,
color: Theme.of(context).accentTextTheme!.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
SizedBox(height: 10.0),

View file

@ -48,10 +48,7 @@ class AlertWithOneAction extends BaseAlertDialog {
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme!
.bodyMedium!
.backgroundColor!,
color: Theme.of(context).primaryColor,
decoration: TextDecoration.none,
),
)),

View file

@ -99,10 +99,7 @@ class BaseAlertDialog extends StatelessWidget {
fontFamily: 'Lato',
fontWeight: FontWeight.w600,
color: rightActionButtonTextColor ??
Theme.of(context)
.primaryTextTheme!
.bodyMedium!
.backgroundColor!,
Theme.of(context).primaryColor,
decoration: TextDecoration.none,
),
)),

View file

@ -448,10 +448,7 @@ class _PickerState<Item> extends State<Picker<Item>> {
),
),
Icon(Icons.check_circle,
color: Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!),
color: Theme.of(context).primaryColor),
],
),
),

View file

@ -24,10 +24,7 @@ class StandardSwitchState extends State<StandardSwitch> {
height: 28,
decoration: BoxDecoration(
color: widget.value
? Theme.of(context)
.accentTextTheme!
.bodyLarge!
.color!
? Theme.of(context).primaryColor
: Theme.of(context)
.accentTextTheme!
.displayLarge!

View file

@ -86,8 +86,6 @@ class BrightTheme extends LightTheme {
),
// subtitle -> titleSmall
titleSmall: TextStyle(
color: Palette
.moderateSlateBlue, // text color of current tile (account list)
decorationColor:
Colors.white // background of current tile (account list)
),
@ -180,8 +178,6 @@ class BrightTheme extends LightTheme {
0.7), // first gradient color bottom panel (exchange page)
decorationColor: Palette.pinkFlamingo.withOpacity(
0.7), // second gradient color bottom panel (exchange page)
backgroundColor:
Palette.moderateSlateBlue // alert right button text
),
// body2 -> bodyLarge
bodyLarge: TextStyle(
@ -269,7 +265,6 @@ class BrightTheme extends LightTheme {
),
// body2 -> bodyLarge
bodyLarge: TextStyle(
color: Palette.moderateSlateBlue, // primary buttons
decorationColor: Colors.white, // alert left button,
backgroundColor: Palette.dullGray // keyboard bar color
)

View file

@ -86,8 +86,6 @@ class DarkTheme extends ThemeBase {
),
// subtitle -> titleSmall
titleSmall: TextStyle(
color: Palette
.blueCraiola, // text color of current tile (account list)
decorationColor: PaletteDark
.darkNightBlue // background of current tile (account list)
),
@ -183,7 +181,6 @@ class DarkTheme extends ThemeBase {
.darkNightBlue, // first gradient color bottom panel (exchange page)
decorationColor: PaletteDark
.darkNightBlue, // second gradient color bottom panel (exchange page)
backgroundColor: Palette.blueCraiola // alert right button text
),
// body2 -> bodyLarge
bodyLarge: TextStyle(
@ -277,7 +274,6 @@ class DarkTheme extends ThemeBase {
),
// body2 -> bodyLarge
bodyLarge: TextStyle(
color: Palette.blueCraiola, // primary buttons
decorationColor: PaletteDark.darkNightBlue, // alert left button
backgroundColor: PaletteDark.granite // keyboard bar color
),

View file

@ -86,8 +86,6 @@ class LightTheme extends ThemeBase {
),
// subtitle -> titleSmall
titleSmall: TextStyle(
color: Palette
.protectiveBlue, // text color of current tile (account list)
decorationColor:
Colors.white // background of current tile (account list)
),
@ -181,7 +179,6 @@ class LightTheme extends ThemeBase {
0.7), // first gradient color bottom panel (exchange page)
decorationColor: Palette.blueGreyCraiola.withOpacity(
0.7), // second gradient color bottom panel (exchange page)
backgroundColor: Palette.protectiveBlue // alert right button text
),
// body2 -> bodyLarge
bodyLarge: TextStyle(
@ -269,7 +266,6 @@ class LightTheme extends ThemeBase {
),
// body2 -> bodyLarge
bodyLarge: TextStyle(
color: Palette.protectiveBlue, // primary buttons
decorationColor: Colors.white, // alert left button,
backgroundColor: Palette.dullGray // keyboard bar color
),