diff --git a/lib/notifications/notification_card_layout.dart b/lib/notifications/notification_card_layout.dart index 44340ad245..191e0da666 100644 --- a/lib/notifications/notification_card_layout.dart +++ b/lib/notifications/notification_card_layout.dart @@ -31,14 +31,12 @@ class NotificationCardLayout extends StatelessWidget { final colors = Theme.of(context).extension()!; final TextStyle titleStyle = isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith(color: colors.textDark) + ? STextStyles.desktopTextExtraExtraSmall(context) + .copyWith(color: colors.textDark) : STextStyles.titleBold12(context); final TextStyle subStyle = isDesktop - ? STextStyles.desktopTextExtraExtraSmall( - context, - ).copyWith(color: colors.textSubtitle1) + ? STextStyles.desktopTextExtraExtraSmall(context) + .copyWith(color: colors.textSubtitle1) : STextStyles.label(context); return Stack( @@ -85,7 +83,9 @@ class NotificationCardLayout extends StatelessWidget { ), if (read) Positioned.fill( - child: RoundedContainer(color: colors.background.withOpacity(0.5)), + child: RoundedContainer( + color: colors.background.withValues(alpha: 0.5), + ), ), ], ); diff --git a/lib/pages/buy_view/buy_form.dart b/lib/pages/buy_view/buy_form.dart index 7973bea163..d163cf8ee7 100644 --- a/lib/pages/buy_view/buy_form.dart +++ b/lib/pages/buy_view/buy_form.dart @@ -880,7 +880,7 @@ class _BuyFormState extends ConsumerState { ? Theme.of(context) .extension()! .currencyListItemBG - .withOpacity(_hovering1 ? 0.3 : 0) + .withValues(alpha: _hovering1 ? 0.3 : 0) : Theme.of(context) .extension()! .textFieldDefaultBG, @@ -946,7 +946,7 @@ class _BuyFormState extends ConsumerState { ? Theme.of(context) .extension()! .currencyListItemBG - .withOpacity(_hovering2 ? 0.3 : 0) + .withValues(alpha: _hovering2 ? 0.3 : 0) : Theme.of(context) .extension()! .textFieldDefaultBG, diff --git a/lib/pages/buy_view/buy_view.dart b/lib/pages/buy_view/buy_view.dart index 552a8457ed..178c041674 100644 --- a/lib/pages/buy_view/buy_view.dart +++ b/lib/pages/buy_view/buy_view.dart @@ -71,9 +71,10 @@ class _BuyViewState extends ConsumerState { ), if (torEnabled) Container( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(0.7), + color: Theme.of(context) + .extension()! + .overlay + .withValues(alpha: 0.7), height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, child: const StackDialog( diff --git a/lib/pages/exchange_view/exchange_coin_selection/exchange_currency_selection_view.dart b/lib/pages/exchange_view/exchange_coin_selection/exchange_currency_selection_view.dart index b5ebfc9b34..53b6133a4f 100644 --- a/lib/pages/exchange_view/exchange_coin_selection/exchange_currency_selection_view.dart +++ b/lib/pages/exchange_view/exchange_coin_selection/exchange_currency_selection_view.dart @@ -80,7 +80,7 @@ class _ExchangeCurrencySelectionViewState color: Theme.of(context) .extension()! .overlay - .withOpacity(0.6), + .withValues(alpha: 0.6), child: const CustomLoadingOverlay( message: "Loading currencies", eventBus: null, diff --git a/lib/pages/exchange_view/exchange_form.dart b/lib/pages/exchange_view/exchange_form.dart index 5040f3b9eb..7f28846388 100644 --- a/lib/pages/exchange_view/exchange_form.dart +++ b/lib/pages/exchange_view/exchange_form.dart @@ -122,7 +122,7 @@ class _ExchangeFormState extends ConsumerState { color: Theme.of(context) .extension()! .overlay - .withOpacity(0.6), + .withValues(alpha: 0.6), child: const CustomLoadingOverlay( message: "Updating exchange rate", eventBus: null, diff --git a/lib/pages/exchange_view/exchange_loading_overlay.dart b/lib/pages/exchange_view/exchange_loading_overlay.dart index 5ccf12cf49..6e1444634a 100644 --- a/lib/pages/exchange_view/exchange_loading_overlay.dart +++ b/lib/pages/exchange_view/exchange_loading_overlay.dart @@ -18,10 +18,7 @@ import '../../widgets/custom_loading_overlay.dart'; import '../../widgets/stack_dialog.dart'; class ExchangeLoadingOverlayView extends ConsumerStatefulWidget { - const ExchangeLoadingOverlayView({ - super.key, - required this.unawaitedLoad, - }); + const ExchangeLoadingOverlayView({super.key, required this.unawaitedLoad}); final VoidCallback unawaitedLoad; @@ -39,10 +36,12 @@ class _ExchangeLoadingOverlayViewState @override void initState() { - _statusEst = - ref.read(changeNowEstimatedInitialLoadStatusStateProvider.state).state; - _statusFixed = - ref.read(changeNowFixedInitialLoadStatusStateProvider.state).state; + _statusEst = ref + .read(changeNowEstimatedInitialLoadStatusStateProvider.state) + .state; + _statusFixed = ref + .read(changeNowFixedInitialLoadStatusStateProvider.state) + .state; super.initState(); } @@ -52,24 +51,26 @@ class _ExchangeLoadingOverlayViewState debugPrint("BUILD: $runtimeType"); ref.listen( - changeNowEstimatedInitialLoadStatusStateProvider - .select((value) => value), (previous, next) { - if (next is ChangeNowLoadStatus) { - setState(() { - _statusEst = next; - }); - } - }); + changeNowEstimatedInitialLoadStatusStateProvider.select((value) => value), + (previous, next) { + if (next is ChangeNowLoadStatus) { + setState(() { + _statusEst = next; + }); + } + }, + ); ref.listen( - changeNowFixedInitialLoadStatusStateProvider.select((value) => value), - (previous, next) { - if (next is ChangeNowLoadStatus) { - setState(() { - _statusFixed = next; - }); - } - }); + changeNowFixedInitialLoadStatusStateProvider.select((value) => value), + (previous, next) { + if (next is ChangeNowLoadStatus) { + setState(() { + _statusFixed = next; + }); + } + }, + ); return Stack( children: [ @@ -79,7 +80,7 @@ class _ExchangeLoadingOverlayViewState color: Theme.of(context) .extension()! .overlay - .withOpacity(0.7), + .withValues(alpha: 0.7), child: const CustomLoadingOverlay( message: "Loading Exchange data", eventBus: null, @@ -93,14 +94,13 @@ class _ExchangeLoadingOverlayViewState color: Theme.of(context) .extension()! .overlay - .withOpacity(0.7), + .withValues(alpha: 0.7), child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ StackDialog( title: "Failed to fetch Exchange data", - message: - "Exchange requires a working internet connection. Tap OK to try fetching again.", + message: "Exchange requires a working internet connection. Tap OK to try fetching again.", rightButton: TextButton( style: Theme.of(context) .extension()! diff --git a/lib/pages/exchange_view/exchange_step_views/step_3_view.dart b/lib/pages/exchange_view/exchange_step_views/step_3_view.dart index b649d56121..4fb89af5d0 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_3_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_3_view.dart @@ -272,7 +272,7 @@ class _Step3ViewState extends ConsumerState { color: Theme.of(context) .extension()! .overlay - .withOpacity(0.6), + .withValues(alpha: 0.6), child: const CustomLoadingOverlay( message: "Creating a trade", eventBus: null, diff --git a/lib/pages/exchange_view/exchange_view.dart b/lib/pages/exchange_view/exchange_view.dart index 276f7e73fa..2f41fa32c8 100644 --- a/lib/pages/exchange_view/exchange_view.dart +++ b/lib/pages/exchange_view/exchange_view.dart @@ -94,9 +94,10 @@ class _ExchangeViewState extends ConsumerState { children: [ child, Material( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(0.6), + color: Theme.of(context) + .extension()! + .overlay + .withValues(alpha: 0.6), child: const CustomLoadingOverlay( message: "Updating exchange data", subMessage: "This could take a few minutes", @@ -151,10 +152,9 @@ class _ExchangeViewState extends ConsumerState { Text( "Trades", style: STextStyles.itemSubtitle(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textDark3, + color: Theme.of(context) + .extension()! + .textDark3, ), ), const SizedBox(height: 12), @@ -173,10 +173,9 @@ class _ExchangeViewState extends ConsumerState { onTap: () async { final String tradeId = trades[index].tradeId; - final lookup = - ref - .read(tradeSentFromStackLookupProvider) - .all; + final lookup = ref + .read(tradeSentFromStackLookupProvider) + .all; //todo: check if print needed // debugPrint("ALL: $lookup"); @@ -198,12 +197,11 @@ class _ExchangeViewState extends ConsumerState { //todo: check if print needed // debugPrint("name: ${manager.walletName}"); - final tx = - await MainDB.instance - .getTransactions(walletIds.first) - .filter() - .txidEqualTo(txid) - .findFirst(); + final tx = await MainDB.instance + .getTransactions(walletIds.first) + .filter() + .txidEqualTo(txid) + .findFirst(); if (mounted) { unawaited( @@ -242,10 +240,9 @@ class _ExchangeViewState extends ConsumerState { padding: const EdgeInsets.symmetric(horizontal: 4), child: Container( decoration: BoxDecoration( - color: - Theme.of( - context, - ).extension()!.popupBG, + color: Theme.of(context) + .extension()! + .popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), diff --git a/lib/pages/exchange_view/send_from_view.dart b/lib/pages/exchange_view/send_from_view.dart index 7c0fd140cd..b2c64d2df9 100644 --- a/lib/pages/exchange_view/send_from_view.dart +++ b/lib/pages/exchange_view/send_from_view.dart @@ -578,7 +578,7 @@ class _SendFromCardState extends ConsumerState { children: [ Container( decoration: BoxDecoration( - color: ref.watch(pCoinColor(coin)).withOpacity(0.5), + color: ref.watch(pCoinColor(coin)).withValues(alpha: 0.5), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), diff --git a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart index a2ffe26db3..62b18c8715 100644 --- a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart +++ b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart @@ -111,9 +111,10 @@ class _WalletInitiatedExchangeViewState children: [ child, Material( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(0.6), + color: Theme.of(context) + .extension()! + .overlay + .withValues(alpha: 0.6), child: const CustomLoadingOverlay( message: "Updating exchange data", subMessage: "This could take a few minutes", @@ -125,8 +126,9 @@ class _WalletInitiatedExchangeViewState }, child: Background( child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of(context) + .extension()! + .background, appBar: AppBar( leading: AppBarBackButton( onPressed: () async { diff --git a/lib/pages/paynym/subwidgets/paynym_card_button.dart b/lib/pages/paynym/subwidgets/paynym_card_button.dart index 8f7026be3b..d5bb3e3709 100644 --- a/lib/pages/paynym/subwidgets/paynym_card_button.dart +++ b/lib/pages/paynym/subwidgets/paynym_card_button.dart @@ -10,6 +10,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; + import '../../../models/paynym/paynym_account_lite.dart'; import '../dialogs/paynym_details_popup.dart'; import 'paynym_bot.dart'; @@ -44,16 +45,17 @@ class _PaynymCardButtonState extends ConsumerState { padding: const EdgeInsets.all(4), child: RoundedContainer( padding: const EdgeInsets.all(0), - color: isDesktop && + color: + isDesktop && ref .watch(selectedPaynymDetailsItemProvider.state) .state ?.nymId == widget.accountLite.nymId ? Theme.of(context) - .extension()! - .accentColorDark - .withOpacity(0.08) + .extension()! + .accentColorDark + .withValues(alpha: 0.08) : Colors.transparent, child: RawMaterialButton( padding: const EdgeInsets.all(0), @@ -79,20 +81,12 @@ class _PaynymCardButtonState extends ConsumerState { }, child: Padding( padding: isDesktop - ? const EdgeInsets.symmetric( - vertical: 8, - horizontal: 12, - ) + ? const EdgeInsets.symmetric(vertical: 8, horizontal: 12) : const EdgeInsets.all(8.0), child: Row( children: [ - PayNymBot( - size: 36, - paymentCodeString: widget.accountLite.code, - ), - const SizedBox( - width: 12, - ), + PayNymBot(size: 36, paymentCodeString: widget.accountLite.code), + const SizedBox(width: 12), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -101,16 +95,14 @@ class _PaynymCardButtonState extends ConsumerState { widget.accountLite.nymName, style: isDesktop ? STextStyles.desktopTextExtraExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, - ) + .copyWith( + color: Theme.of(context) + .extension()! + .textFieldActiveText, + ) : STextStyles.w500_14(context), ), - const SizedBox( - height: 2, - ), + const SizedBox(height: 2), Text( Format.shorten(widget.accountLite.code, 12, 5), style: isDesktop diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index 61f8ae5fbe..0ac4d86eb0 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -161,8 +161,7 @@ class _ReceiveViewState extends ConsumerState { if (slatepackString == null) return; if (mounted) { - final wallet = - ref.read(pWallets).getWallet(walletId) as EpiccashWallet; + final wallet = ref.read(pWallets).getWallet(walletId) as EpiccashWallet; Exception? ex; final result = await showLoading( @@ -226,9 +225,10 @@ class _ReceiveViewState extends ConsumerState { return WillPopScope( onWillPop: () async => shouldPop, child: Container( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(0.5), + color: Theme.of(context) + .extension()! + .overlay + .withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, @@ -285,9 +285,8 @@ class _ReceiveViewState extends ConsumerState { shouldPop = true; if (mounted) { - Navigator.of( - context, - ).popUntil(ModalRoute.withName(ReceiveView.routeName)); + Navigator.of(context) + .popUntil(ModalRoute.withName(ReceiveView.routeName)); setState(() { _addressMap[_walletAddressTypes[_currentIndex]] = @@ -308,9 +307,10 @@ class _ReceiveViewState extends ConsumerState { return WillPopScope( onWillPop: () async => shouldPop, child: Container( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(0.5), + color: Theme.of(context) + .extension()! + .overlay + .withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, @@ -553,17 +553,16 @@ class _ReceiveViewState extends ConsumerState { child: AspectRatio( aspectRatio: 1, child: AppBarIconButton( - semanticsLabel: - "Address List Pop-up Button. Opens A Pop-up For Address List Button.", + semanticsLabel: "Address List Pop-up Button. Opens A Pop-up For Address List Button.", key: const Key("walletNetworkSettingsAddNewNodeViewButton"), size: 36, shadows: const [], color: Theme.of(context).extension()!.background, icon: SvgPicture.asset( Assets.svg.verticalEllipsis, - color: Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of(context) + .extension()! + .accentColorDark, width: 20, height: 20, ), @@ -580,9 +579,9 @@ class _ReceiveViewState extends ConsumerState { right: 10, child: Container( decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.popupBG, + color: Theme.of(context) + .extension()! + .popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -651,9 +650,9 @@ class _ReceiveViewState extends ConsumerState { Text( "Address type", style: STextStyles.w500_14(context).copyWith( - color: Theme.of( - context, - ).extension()!.infoItemLabel, + color: Theme.of(context) + .extension()! + .infoItemLabel, ), ), const SizedBox(height: 10), diff --git a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart index ec57cf0a53..5eb6cedb0d 100644 --- a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart +++ b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart @@ -57,43 +57,42 @@ class _MwcSlatepackDialogState extends ConsumerState { Widget build(BuildContext context) { return ConditionalParent( condition: Util.isDesktop, - builder: - (child) => Column( - mainAxisSize: MainAxisSize.min, + builder: (child) => Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Header with title and close button. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - // Header with title and close button. - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.only(left: 32), - child: Text( - "Send Slatepack", - style: STextStyles.pageTitleH2(context), - ), - ), - const DesktopDialogCloseButton(), - ], + Padding( + padding: const EdgeInsets.only(left: 32), + child: Text( + "Send Slatepack", + style: STextStyles.pageTitleH2(context), + ), ), - Padding(padding: const EdgeInsets.all(32), child: child), + const DesktopDialogCloseButton(), ], ), + Padding(padding: const EdgeInsets.all(32), child: child), + ], + ), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ // Instructions. RoundedContainer( - color: - Theme.of(context).extension()!.textFieldDefaultBG, + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "Next Steps:", - style: STextStyles.label( - context, - ).copyWith(fontWeight: FontWeight.w600), + style: STextStyles.label(context) + .copyWith(fontWeight: FontWeight.w600), ), const SizedBox(height: 8), Text( @@ -117,7 +116,7 @@ class _MwcSlatepackDialogState extends ConsumerState { // decoration: BoxDecoration( // color: Theme.of( // context, - // ).extension()!.infoItemIcons.withOpacity(0.1), + // ).extension()!.infoItemIcons.withValues(alpha: 0.1), // borderRadius: BorderRadius.circular(8), // ), // child: Row( @@ -174,10 +173,9 @@ class _MwcSlatepackDialogState extends ConsumerState { Assets.svg.copy, width: 10, height: 10, - color: - Theme.of( - context, - ).extension()!.infoItemIcons, + color: Theme.of(context) + .extension()! + .infoItemIcons, ), const SizedBox(width: 4), Text("Copy", style: STextStyles.link2(context)), @@ -195,9 +193,8 @@ class _MwcSlatepackDialogState extends ConsumerState { child: SingleChildScrollView( child: SelectableText( widget.slatepackResult.slatepack!, - style: STextStyles.w400_14( - context, - ).copyWith(fontFamily: 'monospace'), + style: STextStyles.w400_14(context) + .copyWith(fontFamily: 'monospace'), ), ), ), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart index 849f10be09..f01caab230 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart @@ -95,15 +95,15 @@ class _AutoBackupViewState extends ConsumerState { title: "Enable Auto Backup", message: "To enable Auto Backup, you need to create a backup file.", leftButton: TextButton( - style: Theme.of( - context, - ).extension()!.getSecondaryEnabledButtonStyle(context), + style: Theme.of(context) + .extension()! + .getSecondaryEnabledButtonStyle(context), child: Text( "Back", style: STextStyles.button(context).copyWith( - color: Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of(context) + .extension()! + .accentColorDark, ), ), onPressed: () { @@ -111,9 +111,9 @@ class _AutoBackupViewState extends ConsumerState { }, ), rightButton: TextButton( - style: Theme.of( - context, - ).extension()!.getPrimaryEnabledButtonStyle(context), + style: Theme.of(context) + .extension()! + .getPrimaryEnabledButtonStyle(context), child: Text("Continue", style: STextStyles.button(context)), onPressed: () { Navigator.of(context).pop(true); @@ -124,15 +124,15 @@ class _AutoBackupViewState extends ConsumerState { ); if (mounted) { if (result is bool && result) { - Navigator.of(context).pushNamed(CreateAutoBackupView.routeName).then(( - _, - ) { - // set toggle to correct state - if (_toggle != - ref.read(prefsChangeNotifierProvider).isAutoBackupEnabled) { - toggleController.activate?.call(); - } - }); + Navigator.of(context) + .pushNamed(CreateAutoBackupView.routeName) + .then((_) { + // set toggle to correct state + if (_toggle != + ref.read(prefsChangeNotifierProvider).isAutoBackupEnabled) { + toggleController.activate?.call(); + } + }); } else { toggleController.activate?.call(); } @@ -147,18 +147,17 @@ class _AutoBackupViewState extends ConsumerState { builder: (context) { return StackDialog( title: "Disable Auto Backup", - message: - "You are turning off Auto Backup. You can turn it back on at any time. Your previous Auto Backup file will not be deleted. Remember to backup your wallets manually so you don't lose important information.", + message: "You are turning off Auto Backup. You can turn it back on at any time. Your previous Auto Backup file will not be deleted. Remember to backup your wallets manually so you don't lose important information.", leftButton: TextButton( - style: Theme.of( - context, - ).extension()!.getSecondaryEnabledButtonStyle(context), + style: Theme.of(context) + .extension()! + .getSecondaryEnabledButtonStyle(context), child: Text( "Back", style: STextStyles.button(context).copyWith( - color: Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of(context) + .extension()! + .accentColorDark, ), ), onPressed: () { @@ -166,9 +165,9 @@ class _AutoBackupViewState extends ConsumerState { }, ), rightButton: TextButton( - style: Theme.of( - context, - ).extension()!.getPrimaryEnabledButtonStyle(context), + style: Theme.of(context) + .extension()! + .getPrimaryEnabledButtonStyle(context), child: Text("Disable", style: STextStyles.button(context)), onPressed: () { Navigator.of(context).pop(true); @@ -180,9 +179,8 @@ class _AutoBackupViewState extends ConsumerState { if (mounted) { if (result is bool && result) { ref.read(prefsChangeNotifierProvider).isAutoBackupEnabled = false; - Navigator.of( - context, - ).popUntil(ModalRoute.withName(AutoBackupView.routeName)); + Navigator.of(context) + .popUntil(ModalRoute.withName(AutoBackupView.routeName)); } else { toggleController.activate?.call(); } @@ -369,7 +367,7 @@ class _AutoBackupViewState extends ConsumerState { color: Theme.of(context) .extension()! .textDark - .withOpacity(0.5), + .withValues(alpha: 0.5), ), readOnly: true, enableSuggestions: false, @@ -401,7 +399,7 @@ class _AutoBackupViewState extends ConsumerState { color: Theme.of(context) .extension()! .textDark - .withOpacity(0.5), + .withValues(alpha: 0.5), ), obscureText: true, enableSuggestions: false, @@ -432,9 +430,10 @@ class _AutoBackupViewState extends ConsumerState { controller: frequencyController, enabled: false, style: STextStyles.field(context).copyWith( - color: Theme.of( - context, - ).extension()!.textDark.withOpacity(0.5), + color: Theme.of(context) + .extension()! + .textDark + .withValues(alpha: 0.5), ), toolbarOptions: const ToolbarOptions( copy: true, @@ -448,9 +447,8 @@ class _AutoBackupViewState extends ConsumerState { child: CustomTextButton( text: "Edit Auto Backup", onTap: () async { - Navigator.of( - context, - ).pushNamed(EditAutoBackupView.routeName); + Navigator.of(context) + .pushNamed(EditAutoBackupView.routeName); }, ), ), diff --git a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart index 0caa4720dd..0cebc01824 100644 --- a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart +++ b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart @@ -111,7 +111,7 @@ class _StartupWalletSelectionViewState ), ), ) - .withOpacity(0.5), + .withValues(alpha: 0.5), borderRadius: BorderRadius.circular( Constants @@ -199,10 +199,9 @@ class _StartupWalletSelectionViewState height: 20, width: 20, child: Radio( - activeColor: - Theme.of(context) - .extension()! - .radioButtonIconEnabled, + activeColor: Theme.of(context) + .extension()! + .radioButtonIconEnabled, value: wallet.walletId, groupValue: ref.watch( prefsChangeNotifierProvider @@ -214,10 +213,11 @@ class _StartupWalletSelectionViewState onChanged: (value) { if (value is String) { ref - .read( - prefsChangeNotifierProvider, - ) - .startupWalletId = value; + .read( + prefsChangeNotifierProvider, + ) + .startupWalletId = + value; } }, ), diff --git a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart index c5916cf708..b87fed9cbf 100644 --- a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart +++ b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart @@ -44,8 +44,9 @@ class WalletSyncingOptionsView extends ConsumerWidget { builder: (child) { return Background( child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of(context) + .extension()! + .background, appBar: AppBar( leading: AppBarBackButton( onPressed: () async { @@ -98,12 +99,11 @@ class WalletSyncingOptionsView extends ConsumerWidget { const SizedBox(height: 12), RoundedWhiteContainer( padding: const EdgeInsets.all(0), - borderColor: - !isDesktop - ? Colors.transparent - : Theme.of( - context, - ).extension()!.background, + borderColor: !isDesktop + ? Colors.transparent + : Theme.of(context) + .extension()! + .background, child: Column( children: [ ...walletInfos.map( @@ -118,7 +118,7 @@ class WalletSyncingOptionsView extends ConsumerWidget { decoration: BoxDecoration( color: ref .watch(pCoinColor(info.coin)) - .withOpacity(0.5), + .withValues(alpha: 0.5), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -177,24 +177,23 @@ class WalletSyncingOptionsView extends ConsumerWidget { child: DraggableSwitchButton( isOn: ref .watch( - prefsChangeNotifierProvider.select( - (value) => - value + prefsChangeNotifierProvider + .select( + (value) => value .walletIdsSyncOnStartup, - ), + ), ) .contains(info.walletId), onValueChanged: (value) { // final syncType = ref // .read(prefsChangeNotifierProvider) // .syncType; - final ids = - ref - .read( - prefsChangeNotifierProvider, - ) - .walletIdsSyncOnStartup - .toList(); + final ids = ref + .read( + prefsChangeNotifierProvider, + ) + .walletIdsSyncOnStartup + .toList(); if (value) { ids.add(info.walletId); } else { @@ -222,10 +221,11 @@ class WalletSyncingOptionsView extends ConsumerWidget { // } ref - .read( - prefsChangeNotifierProvider, - ) - .walletIdsSyncOnStartup = ids; + .read( + prefsChangeNotifierProvider, + ) + .walletIdsSyncOnStartup = + ids; }, ), ), diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart index 3eccb79285..e2f46b248a 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart @@ -376,9 +376,9 @@ class _WalletNetworkSettingsViewState builder: (child) { return Background( child: Scaffold( - backgroundColor: Theme.of( - context, - ).extension()!.background, + backgroundColor: Theme.of(context) + .extension()! + .background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -403,14 +403,14 @@ class _WalletNetworkSettingsViewState ), size: 36, shadows: const [], - color: Theme.of( - context, - ).extension()!.background, + color: Theme.of(context) + .extension()! + .background, icon: SvgPicture.asset( Assets.svg.verticalEllipsis, - color: Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of(context) + .extension()! + .accentColorDark, width: 20, height: 20, ), @@ -427,9 +427,9 @@ class _WalletNetworkSettingsViewState right: 10, child: Container( decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.popupBG, + color: Theme.of(context) + .extension()! + .popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -537,7 +537,7 @@ class _WalletNetworkSettingsViewState color: Theme.of(context) .extension()! .accentColorGreen - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(_iconSize), ), child: Center( @@ -545,9 +545,9 @@ class _WalletNetworkSettingsViewState Assets.svg.radio, height: isDesktop ? 19 : 14, width: isDesktop ? 19 : 14, - color: Theme.of( - context, - ).extension()!.accentColorGreen, + color: Theme.of(context) + .extension()! + .accentColorGreen, ), ), ), @@ -570,12 +570,12 @@ class _WalletNetworkSettingsViewState ProgressBar( width: progressLength, height: 5, - fillColor: Theme.of( - context, - ).extension()!.accentColorGreen, - backgroundColor: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + fillColor: Theme.of(context) + .extension()! + .accentColorGreen, + backgroundColor: Theme.of(context) + .extension()! + .textFieldDefaultBG, percent: 1, ), ], @@ -600,7 +600,7 @@ class _WalletNetworkSettingsViewState color: Theme.of(context) .extension()! .accentColorYellow - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(_iconSize), ), child: Center( @@ -608,9 +608,9 @@ class _WalletNetworkSettingsViewState Assets.svg.radioSyncing, height: 14, width: 14, - color: Theme.of( - context, - ).extension()!.accentColorYellow, + color: Theme.of(context) + .extension()! + .accentColorYellow, ), ), ), @@ -649,9 +649,8 @@ class _WalletNetworkSettingsViewState coin is Mimblewimblecoin || (coin is Litecoin && ref.watch( - pWalletInfo( - widget.walletId, - ).select((s) => s.isMwebEnabled), + pWalletInfo(widget.walletId) + .select((s) => s.isMwebEnabled), ))) Text( " (Blocks to go: ${_blocksRemaining == -1 ? "?" : _blocksRemaining})", @@ -671,12 +670,12 @@ class _WalletNetworkSettingsViewState ProgressBar( width: progressLength, height: 5, - fillColor: Theme.of( - context, - ).extension()!.accentColorYellow, - backgroundColor: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + fillColor: Theme.of(context) + .extension()! + .accentColorYellow, + backgroundColor: Theme.of(context) + .extension()! + .textFieldDefaultBG, percent: _percent, ), ], @@ -701,7 +700,7 @@ class _WalletNetworkSettingsViewState color: Theme.of(context) .extension()! .accentColorRed - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(_iconSize), ), child: Center( @@ -709,9 +708,9 @@ class _WalletNetworkSettingsViewState Assets.svg.radioProblem, height: 14, width: 14, - color: Theme.of( - context, - ).extension()!.accentColorRed, + color: Theme.of(context) + .extension()! + .accentColorRed, ), ), ), @@ -726,17 +725,17 @@ class _WalletNetworkSettingsViewState Text( "Unable to synchronize", style: STextStyles.w600_12(context).copyWith( - color: Theme.of( - context, - ).extension()!.accentColorRed, + color: Theme.of(context) + .extension()! + .accentColorRed, ), ), Text( "0%", style: STextStyles.syncPercent(context).copyWith( - color: Theme.of( - context, - ).extension()!.accentColorRed, + color: Theme.of(context) + .extension()! + .accentColorRed, ), ), ], @@ -746,12 +745,12 @@ class _WalletNetworkSettingsViewState ProgressBar( width: progressLength, height: 5, - fillColor: Theme.of( - context, - ).extension()!.accentColorRed, - backgroundColor: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + fillColor: Theme.of(context) + .extension()! + .accentColorRed, + backgroundColor: Theme.of(context) + .extension()! + .textFieldDefaultBG, percent: 0, ), ], @@ -763,15 +762,15 @@ class _WalletNetworkSettingsViewState Padding( padding: const EdgeInsets.only(top: 12), child: RoundedContainer( - color: Theme.of( - context, - ).extension()!.warningBackground, + color: Theme.of(context) + .extension()! + .warningBackground, child: Text( "Please check your internet connection and make sure your current node is not having issues.", style: STextStyles.baseXS(context).copyWith( - color: Theme.of( - context, - ).extension()!.warningForeground, + color: Theme.of(context) + .extension()! + .warningForeground, ), ), ), @@ -849,7 +848,7 @@ class _WalletNetworkSettingsViewState color: Theme.of(context) .extension()! .accentColorGreen - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(_iconSize), ), child: Center( @@ -857,9 +856,9 @@ class _WalletNetworkSettingsViewState Assets.svg.tor, height: isDesktop ? 19 : 14, width: isDesktop ? 19 : 14, - color: Theme.of( - context, - ).extension()!.accentColorGreen, + color: Theme.of(context) + .extension()! + .accentColorGreen, ), ), ), @@ -870,9 +869,10 @@ class _WalletNetworkSettingsViewState width: _iconSize, height: _iconSize, decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.textDark.withOpacity(0.08), + color: Theme.of(context) + .extension()! + .textDark + .withValues(alpha: 0.08), borderRadius: BorderRadius.circular(_iconSize), ), child: Center( @@ -880,9 +880,9 @@ class _WalletNetworkSettingsViewState Assets.svg.tor, height: isDesktop ? 19 : 14, width: isDesktop ? 19 : 14, - color: Theme.of( - context, - ).extension()!.textDark, + color: Theme.of(context) + .extension()! + .textDark, ), ), ), @@ -900,9 +900,9 @@ class _WalletNetworkSettingsViewState "Tor status", style: STextStyles.desktopTextExtraExtraSmall(context) .copyWith( - color: Theme.of( - context, - ).extension()!.textDark, + color: Theme.of(context) + .extension()! + .textDark, ), ), if (_torConnectionStatus == @@ -1011,18 +1011,18 @@ class _WalletNetworkSettingsViewState width: _iconSize, height: _iconSize, decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, borderRadius: BorderRadius.circular(_iconSize), ), child: Center( child: SvgPicture.asset( Assets.svg.networkWired, width: 24, - color: Theme.of( - context, - ).extension()!.textDark, + color: Theme.of(context) + .extension()! + .textDark, ), ), ), @@ -1037,9 +1037,9 @@ class _WalletNetworkSettingsViewState STextStyles.desktopTextExtraExtraSmall( context, ).copyWith( - color: Theme.of( - context, - ).extension()!.textDark, + color: Theme.of(context) + .extension()! + .textDark, ), ), Text( @@ -1058,9 +1058,9 @@ class _WalletNetworkSettingsViewState : Assets.svg.chevronDown, width: 12, height: 6, - color: Theme.of( - context, - ).extension()!.textSubtitle1, + color: Theme.of(context) + .extension()! + .textSubtitle1, ), ], ), diff --git a/lib/pages/shopinbit/shopinbit_send_from_view.dart b/lib/pages/shopinbit/shopinbit_send_from_view.dart index fb54b1f41b..7c3b289567 100644 --- a/lib/pages/shopinbit/shopinbit_send_from_view.dart +++ b/lib/pages/shopinbit/shopinbit_send_from_view.dart @@ -115,9 +115,9 @@ class _ShopInBitSendFromViewState extends ConsumerState { builder: (child) { return Background( child: Scaffold( - backgroundColor: Theme.of( - context, - ).extension()!.background, + backgroundColor: Theme.of(context) + .extension()! + .background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -270,9 +270,9 @@ class _ShopInBitSendFromCardState extends ConsumerState { child: Text( "Ok", style: STextStyles.button(context).copyWith( - color: Theme.of( - context, - ).extension()!.buttonTextSecondary, + color: Theme.of(context) + .extension()! + .buttonTextSecondary, ), ), onPressed: () => Navigator.of(context).pop(), @@ -413,9 +413,9 @@ class _ShopInBitSendFromCardState extends ConsumerState { child: Text( "Ok", style: STextStyles.button(context).copyWith( - color: Theme.of( - context, - ).extension()!.buttonTextSecondary, + color: Theme.of(context) + .extension()! + .buttonTextSecondary, ), ), onPressed: () { @@ -464,7 +464,7 @@ class _ShopInBitSendFromCardState extends ConsumerState { children: [ Container( decoration: BoxDecoration( - color: ref.watch(pCoinColor(coin)).withOpacity(0.5), + color: ref.watch(pCoinColor(coin)).withValues(alpha: 0.5), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), diff --git a/lib/pages/shopinbit/shopinbit_step_2.dart b/lib/pages/shopinbit/shopinbit_step_2.dart index 742f198e78..7e8469da6a 100644 --- a/lib/pages/shopinbit/shopinbit_step_2.dart +++ b/lib/pages/shopinbit/shopinbit_step_2.dart @@ -52,9 +52,8 @@ class _ShopInBitStep2State extends ConsumerState { final skipGuidelines = settings.guidelinesAcceptedFor(category); if (skipGuidelines) { - await Navigator.of( - context, - ).pushNamed(ShopInBitStep4.routeName, arguments: category); + await Navigator.of(context) + .pushNamed(ShopInBitStep4.routeName, arguments: category); } else { await Navigator.of(context).pushNamed( ShopInBitStep3.routeName, @@ -90,8 +89,8 @@ class _ShopInBitStep2State extends ConsumerState { ], ), DesktopDialogCloseButton( - onPressedOverride: () => - NestedNavigatorDialog.of(context).close( + onPressedOverride: () => NestedNavigatorDialog.of(context) + .close( args: widget.isActuallyFirstStep ? const .noWarning() : const .genericWarning(), @@ -113,9 +112,9 @@ class _ShopInBitStep2State extends ConsumerState { condition: !isDesktop, builder: (content) => Background( child: Scaffold( - backgroundColor: Theme.of( - context, - ).extension()!.background, + backgroundColor: Theme.of(context) + .extension()! + .background, appBar: AppBar( leading: const AppBarBackButton(), title: Text("ShopinBit", style: STextStyles.navBarTitle(context)), @@ -237,7 +236,7 @@ class _CategoryCard extends StatelessWidget { height: isDesktop ? 48 : 40, decoration: BoxDecoration( shape: BoxShape.circle, - color: colors.textDark.withOpacity(0.1), + color: colors.textDark.withValues(alpha: 0.1), ), alignment: Alignment.center, child: SvgPicture.asset( @@ -263,9 +262,8 @@ class _CategoryCard extends StatelessWidget { description, style: isDesktop ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.itemSubtitle12( - context, - ).copyWith(color: colors.textSubtitle1), + : STextStyles.itemSubtitle12(context) + .copyWith(color: colors.textSubtitle1), ), ], ), diff --git a/lib/pages/shopinbit/shopinbit_ticket_detail.dart b/lib/pages/shopinbit/shopinbit_ticket_detail.dart index fb355d7dbc..64cba4167e 100644 --- a/lib/pages/shopinbit/shopinbit_ticket_detail.dart +++ b/lib/pages/shopinbit/shopinbit_ticket_detail.dart @@ -395,7 +395,7 @@ class _ShopInBitTicketDetailState extends ConsumerState borderRadius: BorderRadius.circular(8), color: status .getColor(Theme.of(context).extension()!) - .withOpacity(0.2), + .withValues(alpha: 0.2), ), child: Text( status.label, @@ -998,8 +998,8 @@ class _ChatBubble extends StatelessWidget { .copyWith( fontSize: 10, color: isFromUser - ? colors.buttonTextPrimary.withOpacity(0.7) - : colors.textSubtitle1.withOpacity(0.7), + ? colors.buttonTextPrimary.withValues(alpha: 0.7) + : colors.textSubtitle1.withValues(alpha: 0.7), ), ), ], diff --git a/lib/pages/shopinbit/shopinbit_tickets_view.dart b/lib/pages/shopinbit/shopinbit_tickets_view.dart index ed62427921..d0f0ddb01e 100644 --- a/lib/pages/shopinbit/shopinbit_tickets_view.dart +++ b/lib/pages/shopinbit/shopinbit_tickets_view.dart @@ -208,9 +208,9 @@ class _ShopInBitTicketsViewState extends ConsumerState { ? "Opening your car research payment..." : "${invoice.status} • Invoice ${invoice.invoiceId}", badgeText: "Resume", - badgeColor: Theme.of( - context, - ).extension()!.accentColorYellow, + badgeColor: Theme.of(context) + .extension()! + .accentColorYellow, loading: _resuming, ), ), @@ -307,9 +307,9 @@ class _ShopInBitTicketsViewState extends ConsumerState { condition: !isDesktop, builder: (child) => Background( child: Scaffold( - backgroundColor: Theme.of( - context, - ).extension()!.background, + backgroundColor: Theme.of(context) + .extension()! + .background, appBar: AppBar( leading: AppBarBackButton( onPressed: () => Navigator.of(context).pop(), @@ -371,9 +371,8 @@ class _RequestRow extends StatelessWidget { final subtitleStyle = isDesktop ? STextStyles.desktopTextExtraExtraSmall(context) - : STextStyles.itemSubtitle12( - context, - ).copyWith(color: stackColors.textSubtitle1); + : STextStyles.itemSubtitle12(context) + .copyWith(color: stackColors.textSubtitle1); return Row( children: [ @@ -434,7 +433,7 @@ class _StatusBadge extends StatelessWidget { padding: const .symmetric(horizontal: 8, vertical: 2), decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), - color: color.withOpacity(0.2), + color: color.withValues(alpha: 0.2), ), child: Text(text, style: style), ); diff --git a/lib/pages/token_view/sub_widgets/token_summary.dart b/lib/pages/token_view/sub_widgets/token_summary.dart index 0f1bd177d4..cb52e97659 100644 --- a/lib/pages/token_view/sub_widgets/token_summary.dart +++ b/lib/pages/token_view/sub_widgets/token_summary.dart @@ -83,9 +83,9 @@ class TokenSummary extends ConsumerWidget { children: [ SvgPicture.asset( Assets.svg.walletDesktop, - color: Theme.of( - context, - ).extension()!.tokenSummaryTextSecondary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextSecondary, width: 12, height: 12, ), @@ -93,9 +93,9 @@ class TokenSummary extends ConsumerWidget { Text( ref.watch(pWalletName(walletId)), style: STextStyles.w500_12(context).copyWith( - color: Theme.of( - context, - ).extension()!.tokenSummaryTextSecondary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextSecondary, ), ), ], @@ -113,9 +113,9 @@ class TokenSummary extends ConsumerWidget { ) .format(balance.total, tokenContract: token), style: STextStyles.pageTitleH1(context).copyWith( - color: Theme.of( - context, - ).extension()!.tokenSummaryTextPrimary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextPrimary, ), ), const SizedBox(width: 10), @@ -131,9 +131,9 @@ class TokenSummary extends ConsumerWidget { Text( "${(balance.total.decimal * price).toAmount(fractionDigits: 2).fiatString(locale: ref.watch(localeServiceChangeNotifierProvider.select((value) => value.locale)))} ${ref.watch(prefsChangeNotifierProvider.select((value) => value.currency))}", style: STextStyles.subtitle500(context).copyWith( - color: Theme.of( - context, - ).extension()!.tokenSummaryTextPrimary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextPrimary, ), ), const SizedBox(height: 20), @@ -152,9 +152,9 @@ class TokenSummary extends ConsumerWidget { (value) => value!.tokenContract.address, ), ), - overrideIconColor: Theme.of( - context, - ).extension()!.topNavIconPrimary, + overrideIconColor: Theme.of(context) + .extension()! + .topNavIconPrimary, ), ), ], @@ -263,9 +263,9 @@ class TokenOptionsButton extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ RawMaterialButton( - fillColor: Theme.of( - context, - ).extension()!.tokenSummaryButtonBG, + fillColor: Theme.of(context) + .extension()! + .tokenSummaryButtonBG, elevation: 0, focusElevation: 0, hoverElevation: 0, @@ -283,26 +283,27 @@ class TokenOptionsButton extends StatelessWidget { condition: iconSize < 24, builder: (child) => RoundedContainer( padding: const EdgeInsets.all(6), - color: Theme.of( - context, - ).extension()!.tokenSummaryIcon.withOpacity(0.4), + color: Theme.of(context) + .extension()! + .tokenSummaryIcon + .withValues(alpha: 0.4), radiusMultiplier: 10, child: Center(child: child), ), child: iconAssetPathSVG.startsWith("assets/") ? SvgPicture.asset( iconAssetPathSVG, - color: Theme.of( - context, - ).extension()!.tokenSummaryIcon, + color: Theme.of(context) + .extension()! + .tokenSummaryIcon, width: iconSize, height: iconSize, ) : SvgPicture.file( File(iconAssetPathSVG), - color: Theme.of( - context, - ).extension()!.tokenSummaryIcon, + color: Theme.of(context) + .extension()! + .tokenSummaryIcon, width: iconSize, height: iconSize, ), @@ -313,9 +314,9 @@ class TokenOptionsButton extends StatelessWidget { Text( subLabel, style: STextStyles.w500_12(context).copyWith( - color: Theme.of( - context, - ).extension()!.tokenSummaryTextPrimary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextPrimary, ), ), ], diff --git a/lib/pages/token_view/sub_widgets/token_summary_sol.dart b/lib/pages/token_view/sub_widgets/token_summary_sol.dart index 9d627c1f58..b6a5d8b178 100644 --- a/lib/pages/token_view/sub_widgets/token_summary_sol.dart +++ b/lib/pages/token_view/sub_widgets/token_summary_sol.dart @@ -63,8 +63,9 @@ class SolanaTokenSummary extends ConsumerWidget { child: Text( "Loading token data...", style: STextStyles.subtitle500(context).copyWith( - color: - Theme.of(context).extension()!.tokenSummaryTextPrimary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextPrimary, ), ), ), @@ -73,12 +74,7 @@ class SolanaTokenSummary extends ConsumerWidget { // Watch the balance from the database provider. final balance = ref.watch( - pSolanaTokenBalance( - ( - walletId: walletId, - tokenMint: tokenMint, - ), - ), + pSolanaTokenBalance((walletId: walletId, tokenMint: tokenMint)), ); Decimal? price; @@ -103,9 +99,9 @@ class SolanaTokenSummary extends ConsumerWidget { children: [ SvgPicture.asset( Assets.svg.walletDesktop, - color: Theme.of( - context, - ).extension()!.tokenSummaryTextSecondary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextSecondary, width: 12, height: 12, ), @@ -113,9 +109,9 @@ class SolanaTokenSummary extends ConsumerWidget { Text( ref.watch(pWalletName(walletId)), style: STextStyles.w500_12(context).copyWith( - color: Theme.of( - context, - ).extension()!.tokenSummaryTextSecondary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextSecondary, ), ), ], @@ -125,17 +121,17 @@ class SolanaTokenSummary extends ConsumerWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - balance.total.decimal.toStringAsFixed(tokenWallet.tokenDecimals), + balance.total.decimal.toStringAsFixed( + tokenWallet.tokenDecimals, + ), style: STextStyles.pageTitleH1(context).copyWith( - color: Theme.of( - context, - ).extension()!.tokenSummaryTextPrimary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextPrimary, ), ), const SizedBox(width: 10), - CoinTickerTag( - ticker: tokenWallet.tokenSymbol, - ), + CoinTickerTag(ticker: tokenWallet.tokenSymbol), ], ), if (price != null) const SizedBox(height: 6), @@ -143,9 +139,9 @@ class SolanaTokenSummary extends ConsumerWidget { Text( "${(balance.total.decimal * price).toAmount(fractionDigits: 2).fiatString(locale: ref.watch(localeServiceChangeNotifierProvider.select((value) => value.locale)))} ${ref.watch(prefsChangeNotifierProvider.select((value) => value.currency))}", style: STextStyles.subtitle500(context).copyWith( - color: Theme.of( - context, - ).extension()!.tokenSummaryTextPrimary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextPrimary, ), ), const SizedBox(height: 20), @@ -163,8 +159,9 @@ class SolanaTokenSummary extends ConsumerWidget { walletId: walletId, initialSyncStatus: initialSyncStatus, tokenContractAddress: tokenMint, - overrideIconColor: - Theme.of(context).extension()!.topNavIconPrimary, + overrideIconColor: Theme.of(context) + .extension()! + .topNavIconPrimary, ), ), ], @@ -250,8 +247,9 @@ class TokenOptionsButton extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ RawMaterialButton( - fillColor: - Theme.of(context).extension()!.tokenSummaryButtonBG, + fillColor: Theme.of(context) + .extension()! + .tokenSummaryButtonBG, elevation: 0, focusElevation: 0, hoverElevation: 0, @@ -267,36 +265,32 @@ class TokenOptionsButton extends StatelessWidget { padding: const EdgeInsets.all(10), child: ConditionalParent( condition: iconSize < 24, - builder: - (child) => RoundedContainer( - padding: const EdgeInsets.all(6), - color: Theme.of(context) - .extension()! - .tokenSummaryIcon - .withOpacity(0.4), - radiusMultiplier: 10, - child: Center(child: child), - ), - child: - iconAssetPathSVG.startsWith("assets/") - ? SvgPicture.asset( - iconAssetPathSVG, - color: - Theme.of( - context, - ).extension()!.tokenSummaryIcon, - width: iconSize, - height: iconSize, - ) - : SvgPicture.file( - File(iconAssetPathSVG), - color: - Theme.of( - context, - ).extension()!.tokenSummaryIcon, - width: iconSize, - height: iconSize, - ), + builder: (child) => RoundedContainer( + padding: const EdgeInsets.all(6), + color: Theme.of(context) + .extension()! + .tokenSummaryIcon + .withValues(alpha: 0.4), + radiusMultiplier: 10, + child: Center(child: child), + ), + child: iconAssetPathSVG.startsWith("assets/") + ? SvgPicture.asset( + iconAssetPathSVG, + color: Theme.of(context) + .extension()! + .tokenSummaryIcon, + width: iconSize, + height: iconSize, + ) + : SvgPicture.file( + File(iconAssetPathSVG), + color: Theme.of(context) + .extension()! + .tokenSummaryIcon, + width: iconSize, + height: iconSize, + ), ), ), ), @@ -304,10 +298,9 @@ class TokenOptionsButton extends StatelessWidget { Text( subLabel, style: STextStyles.w500_12(context).copyWith( - color: - Theme.of( - context, - ).extension()!.tokenSummaryTextPrimary, + color: Theme.of(context) + .extension()! + .tokenSummaryTextPrimary, ), ), ], diff --git a/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart b/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart index 68e0123bc8..33d478116c 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart @@ -101,10 +101,9 @@ class WalletSummaryInfo extends ConsumerWidget { "${_showAvailable ? "Available" : "Full"} ${type.name.capitalize()} balance"; switch (type) { case BalanceType.private: - final balance = - coin is Firo - ? ref.watch(pWalletBalanceTertiary(walletId)) - : ref.watch(pWalletBalanceSecondary(walletId)); + final balance = coin is Firo + ? ref.watch(pWalletBalanceTertiary(walletId)) + : ref.watch(pWalletBalanceSecondary(walletId)); balanceToShow = _showAvailable ? balance.spendable : balance.total; break; @@ -122,23 +121,21 @@ class WalletSummaryInfo extends ConsumerWidget { List? imageBytes; if (coin is Banano) { - imageBytes = - (ref.watch(pWallets).getWallet(walletId) as BananoWallet) - .getMonkeyImageBytes(); + imageBytes = (ref.watch(pWallets).getWallet(walletId) as BananoWallet) + .getMonkeyImageBytes(); } return ConditionalParent( condition: imageBytes != null, - builder: - (child) => Stack( - children: [ - Positioned.fill( - left: 150.0, - child: SvgPicture.memory(Uint8List.fromList(imageBytes!)), - ), - child, - ], + builder: (child) => Stack( + children: [ + Positioned.fill( + left: 150.0, + child: SvgPicture.memory(Uint8List.fromList(imageBytes!)), ), + child, + ], + ), child: Row( children: [ Expanded( @@ -151,12 +148,14 @@ class WalletSummaryInfo extends ConsumerWidget { if (ref.read(walletBalanceToggleStateProvider) == WalletBalanceToggleState.available) { ref - .read(walletBalanceToggleStateProvider.notifier) - .state = WalletBalanceToggleState.full; + .read(walletBalanceToggleStateProvider.notifier) + .state = + WalletBalanceToggleState.full; } else { ref - .read(walletBalanceToggleStateProvider.notifier) - .state = WalletBalanceToggleState.available; + .read(walletBalanceToggleStateProvider.notifier) + .state = + WalletBalanceToggleState.available; } } else { showSheet(context); @@ -167,20 +166,18 @@ class WalletSummaryInfo extends ConsumerWidget { Text( title, style: STextStyles.subtitle500(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFavoriteCard, + color: Theme.of(context) + .extension()! + .textFavoriteCard, ), ), if (!toggleBalance) ...[ const SizedBox(width: 4), SvgPicture.asset( Assets.svg.chevronDown, - color: - Theme.of( - context, - ).extension()!.textFavoriteCard, + color: Theme.of(context) + .extension()! + .textFavoriteCard, width: 8, height: 4, ), @@ -199,7 +196,7 @@ class WalletSummaryInfo extends ConsumerWidget { color: Theme.of(context) .extension()! .textFavoriteCard - .withOpacity(0.7), + .withValues(alpha: 0.7), ), ), ), @@ -210,10 +207,9 @@ class WalletSummaryInfo extends ConsumerWidget { ref.watch(pAmountFormatter(coin)).format(balanceToShow), style: STextStyles.pageTitleH1(context).copyWith( fontSize: 24, - color: - Theme.of( - context, - ).extension()!.textFavoriteCard, + color: Theme.of(context) + .extension()! + .textFavoriteCard, ), ), ), @@ -221,10 +217,9 @@ class WalletSummaryInfo extends ConsumerWidget { Text( "${(price.value * balanceToShow.decimal).toAmount(fractionDigits: 2).fiatString(locale: locale)} $baseCurrency", style: STextStyles.subtitle500(context).copyWith( - color: - Theme.of( - context, - ).extension()!.textFavoriteCard, + color: Theme.of(context) + .extension()! + .textFavoriteCard, ), ), ], diff --git a/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart b/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart index 944aed6be7..8fcdf0705c 100644 --- a/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart +++ b/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart @@ -326,8 +326,10 @@ class _DesktopAddressBook extends ConsumerState { color: Theme.of(context) .extension()! .accentColorDark - .withOpacity( - currentContactId == favorites[i].customId + .withValues( + alpha: + currentContactId == + favorites[i].customId ? 0.08 : 0, ), @@ -397,8 +399,9 @@ class _DesktopAddressBook extends ConsumerState { color: Theme.of(context) .extension()! .accentColorDark - .withOpacity( - currentContactId == + .withValues( + alpha: + currentContactId == allContacts[i].customId ? 0.08 : 0, diff --git a/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart b/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart index 77781396a0..206f6af81a 100644 --- a/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart +++ b/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart @@ -98,9 +98,10 @@ class _DesktopBuyViewState extends ConsumerState { ), if (torEnabled) Container( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(0.7), + color: Theme.of(context) + .extension()! + .overlay + .withValues(alpha: 0.7), height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, child: DesktopDialog( @@ -122,9 +123,9 @@ class _DesktopBuyViewState extends ConsumerState { "Purchasing not available while Tor is enabled", textAlign: TextAlign.center, style: STextStyles.desktopTextMedium(context).copyWith( - color: Theme.of( - context, - ).extension()!.infoItemLabel, + color: Theme.of(context) + .extension()! + .infoItemLabel, ), ), ], diff --git a/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart b/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart index d0d0fda659..5f7e70c86f 100644 --- a/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart +++ b/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart @@ -10,6 +10,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; + import '../../pages/exchange_view/exchange_form.dart'; import 'desktop_all_trades_view.dart'; import 'subwidgets/desktop_trade_history.dart'; @@ -89,7 +90,7 @@ class _DesktopExchangeViewState extends ConsumerState { color: Theme.of(context) .extension()! .overlay - .withOpacity(0.6), + .withValues(alpha: 0.6), child: const CustomLoadingOverlay( message: "Updating exchange data", subMessage: "This could take a few minutes", @@ -103,21 +104,12 @@ class _DesktopExchangeViewState extends ConsumerState { appBar: DesktopAppBar( isCompactHeight: true, leading: Padding( - padding: const EdgeInsets.only( - left: 24, - ), - child: Text( - "Swap", - style: STextStyles.desktopH3(context), - ), + padding: const EdgeInsets.only(left: 24), + child: Text("Swap", style: STextStyles.desktopH3(context)), ), ), body: Padding( - padding: const EdgeInsets.only( - left: 24, - right: 24, - bottom: 24, - ), + padding: const EdgeInsets.only(left: 24, right: 24, bottom: 24), child: Column( children: [ Row( @@ -128,24 +120,22 @@ class _DesktopExchangeViewState extends ConsumerState { style: STextStyles.desktopTextExtraExtraSmall(context), ), ), - const SizedBox( - width: 16, - ), + const SizedBox(width: 16), Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "Recent trades", - style: - STextStyles.desktopTextExtraExtraSmall(context), + style: STextStyles.desktopTextExtraExtraSmall( + context, + ), ), CustomTextButton( text: "See all", onTap: () { - Navigator.of(context).pushNamed( - DesktopAllTradesView.routeName, - ); + Navigator.of(context) + .pushNamed(DesktopAllTradesView.routeName); }, ), ], @@ -153,9 +143,7 @@ class _DesktopExchangeViewState extends ConsumerState { ), ], ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), Expanded( child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -170,16 +158,10 @@ class _DesktopExchangeViewState extends ConsumerState { ], ), ), - const SizedBox( - width: 16, - ), + const SizedBox(width: 16), const Expanded( child: Row( - children: [ - Expanded( - child: DesktopTradeHistory(), - ), - ], + children: [Expanded(child: DesktopTradeHistory())], ), ), ], diff --git a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart index 0cf8770a0b..159abfe651 100644 --- a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart +++ b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart @@ -83,7 +83,7 @@ class _StepScaffoldState extends ConsumerState { color: Theme.of(context) .extension()! .overlay - .withOpacity(0.6), + .withValues(alpha: 0.6), child: const CustomLoadingOverlay( message: "Creating a trade", eventBus: null, diff --git a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_exchange_steps_indicator.dart b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_exchange_steps_indicator.dart index c8d4ba9ff8..30ba6788b9 100644 --- a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_exchange_steps_indicator.dart +++ b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_exchange_steps_indicator.dart @@ -9,6 +9,7 @@ */ import 'package:flutter/material.dart'; + import '../../../themes/stack_colors.dart'; import '../../../utilities/text_styles.dart'; import '../../../widgets/rounded_container.dart'; @@ -23,7 +24,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { return Theme.of(context) .extension()! .accentColorBlue - .withOpacity(0.5); + .withValues(alpha: 0.5); } else { return Theme.of(context).extension()!.textSubtitle3; } @@ -50,31 +51,29 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { AnimatedCrossFade( firstChild: Text( "Confirm amount", - style: - STextStyles.desktopTextExtraExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .accentColorBlue, - ), + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .accentColorBlue, + ), ), secondChild: Text( "Confirm amount", - style: - STextStyles.desktopTextExtraExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .accentColorBlue - .withOpacity(0.5), - ), + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .accentColorBlue + .withValues(alpha: 0.5), + ), ), crossFadeState: currentStep == 1 ? CrossFadeState.showFirst : CrossFadeState.showSecond, duration: duration, ), - const SizedBox( - height: verticalSpacing, - ), + const SizedBox(height: verticalSpacing), RoundedContainer( color: getColor(context, 1), height: barHeight, @@ -83,9 +82,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { ], ), ), - const SizedBox( - width: horizontalSpacing, - ), + const SizedBox(width: horizontalSpacing), SizedBox( width: width, child: Column( @@ -93,32 +90,32 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { AnimatedCrossFade( firstChild: Text( "Enter details", - style: - STextStyles.desktopTextExtraExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle3, - ), + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textSubtitle3, + ), ), secondChild: AnimatedCrossFade( firstChild: Text( "Enter details", style: STextStyles.desktopTextExtraExtraSmall(context) .copyWith( - color: Theme.of(context) - .extension()! - .accentColorBlue, - ), + color: Theme.of(context) + .extension()! + .accentColorBlue, + ), ), secondChild: Text( "Enter details", style: STextStyles.desktopTextExtraExtraSmall(context) .copyWith( - color: Theme.of(context) - .extension()! - .accentColorBlue - .withOpacity(0.5), - ), + color: Theme.of(context) + .extension()! + .accentColorBlue + .withValues(alpha: 0.5), + ), ), crossFadeState: currentStep == 2 && currentStep > 1 ? CrossFadeState.showFirst @@ -130,9 +127,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { : CrossFadeState.showSecond, duration: duration, ), - const SizedBox( - height: verticalSpacing, - ), + const SizedBox(height: verticalSpacing), RoundedContainer( color: getColor(context, 2), height: barHeight, @@ -141,9 +136,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { ], ), ), - const SizedBox( - width: horizontalSpacing, - ), + const SizedBox(width: horizontalSpacing), SizedBox( width: width, child: Column( @@ -151,32 +144,32 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { AnimatedCrossFade( firstChild: Text( "Confirm details", - style: - STextStyles.desktopTextExtraExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle3, - ), + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textSubtitle3, + ), ), secondChild: AnimatedCrossFade( firstChild: Text( "Confirm details", style: STextStyles.desktopTextExtraExtraSmall(context) .copyWith( - color: Theme.of(context) - .extension()! - .accentColorBlue, - ), + color: Theme.of(context) + .extension()! + .accentColorBlue, + ), ), secondChild: Text( "Confirm details", style: STextStyles.desktopTextExtraExtraSmall(context) .copyWith( - color: Theme.of(context) - .extension()! - .accentColorBlue - .withOpacity(0.5), - ), + color: Theme.of(context) + .extension()! + .accentColorBlue + .withValues(alpha: 0.5), + ), ), crossFadeState: currentStep == 3 && currentStep > 2 ? CrossFadeState.showFirst @@ -188,9 +181,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { : CrossFadeState.showSecond, duration: duration, ), - const SizedBox( - height: verticalSpacing, - ), + const SizedBox(height: verticalSpacing), RoundedContainer( color: getColor(context, 3), height: barHeight, @@ -199,9 +190,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { ], ), ), - const SizedBox( - width: horizontalSpacing, - ), + const SizedBox(width: horizontalSpacing), SizedBox( width: width, child: Column( @@ -209,30 +198,28 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { AnimatedCrossFade( firstChild: Text( "Complete exchange", - style: - STextStyles.desktopTextExtraExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle3, - ), + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textSubtitle3, + ), ), secondChild: Text( "Complete exchange", - style: - STextStyles.desktopTextExtraExtraSmall(context).copyWith( - color: Theme.of(context) - .extension()! - .accentColorBlue, - ), + style: STextStyles.desktopTextExtraExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .accentColorBlue, + ), ), crossFadeState: currentStep < 4 ? CrossFadeState.showFirst : CrossFadeState.showSecond, duration: duration, ), - const SizedBox( - height: verticalSpacing, - ), + const SizedBox(height: verticalSpacing), Stack( children: [ RoundedContainer( diff --git a/lib/pages_desktop_specific/desktop_menu_item.dart b/lib/pages_desktop_specific/desktop_menu_item.dart index 60daf23ea8..e14134f3c1 100644 --- a/lib/pages_desktop_specific/desktop_menu_item.dart +++ b/lib/pages_desktop_specific/desktop_menu_item.dart @@ -45,9 +45,10 @@ class DesktopMyStackIcon extends ConsumerWidget { DesktopMenuItemId.myStack == ref.watch(currentDesktopMenuItemProvider.state).state ? Theme.of(context).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.8), + : Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.8), ); } } @@ -65,9 +66,10 @@ class DesktopExchangeIcon extends ConsumerWidget { DesktopMenuItemId.exchange == ref.watch(currentDesktopMenuItemProvider.state).state ? Theme.of(context).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.8), + : Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.8), ); } } @@ -85,9 +87,10 @@ class DesktopBuyIcon extends ConsumerWidget { DesktopMenuItemId.buy == ref.watch(currentDesktopMenuItemProvider.state).state ? Theme.of(context).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.8), + : Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.8), ); } } @@ -105,9 +108,10 @@ class DesktopServicesIcon extends ConsumerWidget { DesktopMenuItemId.services == ref.watch(currentDesktopMenuItemProvider.state).state ? Theme.of(context).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.8), + : Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.8), ); } } @@ -134,9 +138,10 @@ class DesktopNotificationsIcon extends ConsumerWidget { DesktopMenuItemId.notifications == ref.watch(currentDesktopMenuItemProvider.state).state ? Theme.of(context).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.8), + : Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.8), ); } } @@ -154,9 +159,10 @@ class DesktopAddressBookIcon extends ConsumerWidget { DesktopMenuItemId.addressBook == ref.watch(currentDesktopMenuItemProvider.state).state ? Theme.of(context).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.8), + : Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.8), ); } } @@ -174,9 +180,10 @@ class DesktopSettingsIcon extends ConsumerWidget { DesktopMenuItemId.settings == ref.watch(currentDesktopMenuItemProvider.state).state ? Theme.of(context).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.8), + : Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.8), ); } } @@ -194,9 +201,10 @@ class DesktopSupportIcon extends ConsumerWidget { DesktopMenuItemId.support == ref.watch(currentDesktopMenuItemProvider.state).state ? Theme.of(context).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.8), + : Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.8), ); } } @@ -214,9 +222,10 @@ class DesktopAboutIcon extends ConsumerWidget { DesktopMenuItemId.about == ref.watch(currentDesktopMenuItemProvider.state).state ? Theme.of(context).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.8), + : Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.8), ); } } @@ -230,9 +239,10 @@ class DesktopExitIcon extends ConsumerWidget { Assets.svg.exitDesktop, width: 20, height: 20, - color: Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.8), + color: Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.8), ); } } @@ -327,9 +337,9 @@ class _DesktopMenuItemState extends ConsumerState> ? Theme.of(context) .extension()! .getDesktopMenuButtonStyleSelected(context) - : Theme.of( - context, - ).extension()!.getDesktopMenuButtonStyle(context), + : Theme.of(context) + .extension()! + .getDesktopMenuButtonStyle(context), onPressed: () { onChanged(value); }, diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart index eb354eb1e0..4b126806c6 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart @@ -174,8 +174,7 @@ class _DesktopReceiveState extends ConsumerState { } Future _onEpicReceiveSlatePressed() async { - final wallet = - ref.read(pWallets).getWallet(walletId) as EpiccashWallet; + final wallet = ref.read(pWallets).getWallet(walletId) as EpiccashWallet; Exception? ex; final result = await showLoading( @@ -244,9 +243,10 @@ class _DesktopReceiveState extends ConsumerState { return WillPopScope( onWillPop: () async => shouldPop, child: Container( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(0.5), + color: Theme.of(context) + .extension()! + .overlay + .withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, @@ -323,9 +323,10 @@ class _DesktopReceiveState extends ConsumerState { return WillPopScope( onWillPop: () async => shouldPop, child: Container( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(0.5), + color: Theme.of(context) + .extension()! + .overlay + .withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, @@ -557,23 +558,22 @@ class _DesktopReceiveState extends ConsumerState { child: Container( decoration: BoxDecoration( color: - Theme.of( - context, - ).extension()?.textFieldDefaultBG ?? + Theme.of(context) + .extension() + ?.textFieldDefaultBG ?? Colors.white, // Fallback color borderRadius: BorderRadius.circular(8), border: Border.all( color: - Theme.of( - context, - ).extension()?.backgroundAppBar ?? + Theme.of(context) + .extension() + ?.backgroundAppBar ?? Colors.grey, // Fallback color width: 1, ), ), child: const SizedBox( - height: - 60, // Provide an explicit height to avoid infinite constraints + height: 60, // Provide an explicit height to avoid infinite constraints child: MwcTxsMethodToggle(), ), ), @@ -584,30 +584,31 @@ class _DesktopReceiveState extends ConsumerState { child: Container( decoration: BoxDecoration( color: - Theme.of( - context, - ).extension()?.textFieldDefaultBG ?? + Theme.of(context) + .extension() + ?.textFieldDefaultBG ?? Colors.white, // Fallback color borderRadius: BorderRadius.circular(8), border: Border.all( color: - Theme.of( - context, - ).extension()?.backgroundAppBar ?? + Theme.of(context) + .extension() + ?.backgroundAppBar ?? Colors.grey, // Fallback color width: 1, ), ), child: const SizedBox( - height: - 60, // Provide an explicit height to avoid infinite constraints + height: 60, // Provide an explicit height to avoid infinite constraints child: EpicTxsMethodToggle(), ), ), ), - if (!((isMimblewimblecoin || isEpiccash) && ref.watch(pIsSlatepack(widget.walletId)))) + if (!((isMimblewimblecoin || isEpiccash) && + ref.watch(pIsSlatepack(widget.walletId)))) const SizedBox(height: 20), - if (!((isMimblewimblecoin || isEpiccash) && ref.watch(pIsSlatepack(widget.walletId)))) + if (!((isMimblewimblecoin || isEpiccash) && + ref.watch(pIsSlatepack(widget.walletId)))) ConditionalParent( condition: showMultiType, builder: (child) => Column( @@ -652,9 +653,9 @@ class _DesktopReceiveState extends ConsumerState { ), buttonStyleData: ButtonStyleData( decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -664,9 +665,9 @@ class _DesktopReceiveState extends ConsumerState { offset: const Offset(0, -10), elevation: 0, decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -699,9 +700,9 @@ class _DesktopReceiveState extends ConsumerState { child: Container( decoration: BoxDecoration( border: Border.all( - color: Theme.of( - context, - ).extension()!.backgroundAppBar, + color: Theme.of(context) + .extension()! + .backgroundAppBar, width: 1, ), borderRadius: BorderRadius.circular( @@ -726,9 +727,9 @@ class _DesktopReceiveState extends ConsumerState { Assets.svg.copy, width: 15, height: 15, - color: Theme.of( - context, - ).extension()!.infoItemIcons, + color: Theme.of(context) + .extension()! + .infoItemIcons, ), const SizedBox(width: 4), Text("Copy", style: STextStyles.link2(context)), @@ -746,9 +747,9 @@ class _DesktopReceiveState extends ConsumerState { STextStyles.desktopTextExtraExtraSmall( context, ).copyWith( - color: Theme.of( - context, - ).extension()!.textDark, + color: Theme.of(context) + .extension()! + .textDark, ), ), ), @@ -778,7 +779,8 @@ class _DesktopReceiveState extends ConsumerState { label: "Generate new address", ), const SizedBox(height: 20), - if ((isMimblewimblecoin || isEpiccash) && ref.watch(pIsSlatepack(widget.walletId))) + if ((isMimblewimblecoin || isEpiccash) && + ref.watch(pIsSlatepack(widget.walletId))) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -786,9 +788,9 @@ class _DesktopReceiveState extends ConsumerState { Text( "Receive Slatepack", style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of( - context, - ).extension()!.textFieldActiveSearchIconRight, + color: Theme.of(context) + .extension()! + .textFieldActiveSearchIconRight, ), textAlign: TextAlign.left, ), @@ -819,9 +821,9 @@ class _DesktopReceiveState extends ConsumerState { }, focusNode: _slateFocusNode, style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of( - context, - ).extension()!.textFieldActiveText, + color: Theme.of(context) + .extension()! + .textFieldActiveText, height: 1.8, ), decoration: @@ -833,8 +835,7 @@ class _DesktopReceiveState extends ConsumerState { ).copyWith( contentPadding: const EdgeInsets.symmetric( horizontal: 16, - vertical: - 12, // Adjust vertical padding for better alignment + vertical: 12, // Adjust vertical padding for better alignment ), suffixIcon: Padding( padding: _receiveSlateController.text.isEmpty @@ -909,7 +910,8 @@ class _DesktopReceiveState extends ConsumerState { // TODO: create transparent button class to account for hover // Conditional logic for 'Submit' button or QR code - if ((isMimblewimblecoin || isEpiccash) && ref.watch(pIsSlatepack(widget.walletId))) + if ((isMimblewimblecoin || isEpiccash) && + ref.watch(pIsSlatepack(widget.walletId))) Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: PrimaryButton( @@ -917,7 +919,9 @@ class _DesktopReceiveState extends ConsumerState { label: "Receive Slatepack", enabled: _slateToggleFlag, onPressed: _slateToggleFlag - ? (isEpiccash ? _onEpicReceiveSlatePressed : _onReceiveSlatePressed) + ? (isEpiccash + ? _onEpicReceiveSlatePressed + : _onReceiveSlatePressed) : null, ), ) @@ -986,17 +990,17 @@ class _DesktopReceiveState extends ConsumerState { Assets.svg.qrcode, width: 14, height: 16, - color: Theme.of( - context, - ).extension()!.accentColorBlue, + color: Theme.of(context) + .extension()! + .accentColorBlue, ), const SizedBox(width: 8), Text( "Create new QR code", style: STextStyles.desktopTextExtraSmall(context).copyWith( - color: Theme.of( - context, - ).extension()!.accentColorBlue, + color: Theme.of(context) + .extension()! + .accentColorBlue, ), ), ], diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/network_info_button.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/network_info_button.dart index 7a7bc88caf..056158e572 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/network_info_button.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/network_info_button.dart @@ -54,8 +54,9 @@ class _NetworkInfoButtonState extends ConsumerState { walletId = widget.walletId; final wallet = ref.read(pWallets).getWallet(walletId); - eventBus = - widget.eventBus != null ? widget.eventBus! : GlobalEventBus.instance; + eventBus = widget.eventBus != null + ? widget.eventBus! + : GlobalEventBus.instance; if (wallet.refreshMutex.isLocked) { _currentSyncStatus = WalletSyncStatus.syncing; @@ -145,9 +146,8 @@ class _NetworkInfoButtonState extends ConsumerState { return Text( label, - style: STextStyles.desktopMenuItemSelected( - context, - ).copyWith(color: _getColor(status, context)), + style: STextStyles.desktopMenuItemSelected(context) + .copyWith(color: _getColor(status, context)), ); } @@ -165,7 +165,7 @@ class _NetworkInfoButtonState extends ConsumerState { @override Widget build(BuildContext context) { return RawMaterialButton( - hoverColor: _getColor(_currentSyncStatus, context).withOpacity(0.1), + hoverColor: _getColor(_currentSyncStatus, context).withValues(alpha: 0.1), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(1000)), onPressed: () { if (Util.isDesktop) { @@ -212,66 +212,63 @@ class _NetworkInfoButtonState extends ConsumerState { showDialog( context: context, - builder: - (context) => Navigator( - initialRoute: WalletNetworkSettingsView.routeName, - onGenerateRoute: RouteGenerator.generateRoute, - onGenerateInitialRoutes: (_, __) { - return [ - FadePageRoute( - DesktopDialog( - maxHeight: null, - maxWidth: 580, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: const EdgeInsets.only(left: 32), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - "Network", - style: STextStyles.desktopH3(context), - ), - DesktopDialogCloseButton( - onPressedOverride: - Navigator.of( - context, - rootNavigator: true, - ).pop, - ), - ], + builder: (context) => Navigator( + initialRoute: WalletNetworkSettingsView.routeName, + onGenerateRoute: RouteGenerator.generateRoute, + onGenerateInitialRoutes: (_, __) { + return [ + FadePageRoute( + DesktopDialog( + maxHeight: null, + maxWidth: 580, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.only(left: 32), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Network", + style: STextStyles.desktopH3(context), ), + DesktopDialogCloseButton( + onPressedOverride: Navigator.of( + context, + rootNavigator: true, + ).pop, + ), + ], + ), + ), + Flexible( + child: Padding( + padding: const EdgeInsets.only( + top: 16, + left: 32, + right: 32, + bottom: 32, ), - Flexible( - child: Padding( - padding: const EdgeInsets.only( - top: 16, - left: 32, - right: 32, - bottom: 32, - ), - child: SingleChildScrollView( - child: WalletNetworkSettingsView( - walletId: walletId, - initialSyncStatus: _currentSyncStatus, - initialNodeStatus: _currentNodeStatus, - ), - ), + child: SingleChildScrollView( + child: WalletNetworkSettingsView( + walletId: walletId, + initialSyncStatus: _currentSyncStatus, + initialNodeStatus: _currentNodeStatus, ), ), - ], + ), ), - ), - const RouteSettings( - name: WalletNetworkSettingsView.routeName, - ), + ], ), - ]; - }, - ), + ), + const RouteSettings( + name: WalletNetworkSettingsView.routeName, + ), + ), + ]; + }, + ), ); } else { Navigator.of(context).pushNamed( diff --git a/lib/utilities/show_loading.dart b/lib/utilities/show_loading.dart index 39537e37d1..215f48628f 100644 --- a/lib/utilities/show_loading.dart +++ b/lib/utilities/show_loading.dart @@ -46,9 +46,10 @@ Future showLoading({ builder: (_) => WillPopScope( onWillPop: () async => false, child: Container( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(opaqueBG ? 1.0 : 0.6), + color: Theme.of(context) + .extension()! + .overlay + .withValues(alpha: opaqueBG ? 1.0 : 0.6), child: CustomLoadingOverlay( message: message, subMessage: subMessage, diff --git a/lib/utilities/text_styles.dart b/lib/utilities/text_styles.dart index 2337a66222..e3763c5486 100644 --- a/lib/utilities/text_styles.dart +++ b/lib/utilities/text_styles.dart @@ -10,6 +10,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; + import '../themes/stack_colors.dart'; class STextStyles { @@ -467,7 +468,7 @@ class STextStyles { } } -// Desktop + // Desktop static TextStyle desktopH1(BuildContext context) { switch (_theme(context).themeId) { @@ -718,7 +719,7 @@ class STextStyles { switch (_theme(context).themeId) { default: return GoogleFonts.inter( - color: _theme(context).textDark.withOpacity(0.8), + color: _theme(context).textDark.withValues(alpha: 0.8), fontWeight: FontWeight.w500, fontSize: 16, height: 20.8 / 16, @@ -742,7 +743,7 @@ class STextStyles { switch (_theme(context).themeId) { default: return GoogleFonts.inter( - color: _theme(context).textDark.withOpacity(0.5), + color: _theme(context).textDark.withValues(alpha: 0.5), fontWeight: FontWeight.w500, fontSize: 16, height: 20.8 / 16, diff --git a/lib/widgets/custom_buttons/blue_text_button.dart b/lib/widgets/custom_buttons/blue_text_button.dart index 8304498bee..0ea3585715 100644 --- a/lib/widgets/custom_buttons/blue_text_button.dart +++ b/lib/widgets/custom_buttons/blue_text_button.dart @@ -59,7 +59,7 @@ class _CustomTextButtonState extends State<_CustomTextButton> ); animation = ColorTween( begin: widget.enabledColor, - end: widget.enabledColor.withOpacity(0.4), + end: widget.enabledColor.withValues(alpha: 0.4), ).animate(controller!); animation!.addListener(() { @@ -98,7 +98,7 @@ class _CustomTextButtonState extends State<_CustomTextButton> color: Theme.of(context) .extension()! .highlight - .withOpacity(_hovering ? 0.3 : 0), + .withValues(alpha: _hovering ? 0.3 : 0), child: child, ), ), @@ -111,9 +111,8 @@ class _CustomTextButtonState extends State<_CustomTextButton> text: widget.text, style: widget.textSize == null ? STextStyles.link2(context).copyWith(color: color) - : STextStyles.link2( - context, - ).copyWith(color: color, fontSize: widget.textSize), + : STextStyles.link2(context) + .copyWith(color: color, fontSize: widget.textSize), recognizer: widget.enabled ? (TapGestureRecognizer() ..onTap = () { @@ -150,12 +149,12 @@ class CustomTextButton extends StatelessWidget { return _CustomTextButton( key: UniqueKey(), text: text, - enabledColor: Theme.of( - context, - ).extension()!.customTextButtonEnabledText, - disabledColor: Theme.of( - context, - ).extension()!.customTextButtonDisabledText, + enabledColor: Theme.of(context) + .extension()! + .customTextButtonEnabledText, + disabledColor: Theme.of(context) + .extension()! + .customTextButtonDisabledText, enabled: enabled, textSize: textSize, overflow: overflow, diff --git a/lib/widgets/custom_buttons/draggable_switch_button.dart b/lib/widgets/custom_buttons/draggable_switch_button.dart index e0ea21ebf1..1eb0fae3d0 100644 --- a/lib/widgets/custom_buttons/draggable_switch_button.dart +++ b/lib/widgets/custom_buttons/draggable_switch_button.dart @@ -48,9 +48,10 @@ class DraggableSwitchButtonState extends State { Color _colorBG(bool isOn, bool enabled, double alpha) { if (enabled) { return Color.alphaBlend( - Theme.of( - context, - ).extension()!.switchBGOn.withOpacity(alpha), + Theme.of(context) + .extension()! + .switchBGOn + .withValues(alpha: alpha), Theme.of(context).extension()!.switchBGOff, ); } @@ -60,9 +61,10 @@ class DraggableSwitchButtonState extends State { Color _colorFG(bool isOn, bool enabled, double alpha) { if (enabled) { return Color.alphaBlend( - Theme.of( - context, - ).extension()!.switchCircleOn.withOpacity(alpha), + Theme.of(context) + .extension()! + .switchCircleOn + .withValues(alpha: alpha), Theme.of(context).extension()!.switchCircleOff, ); } @@ -126,9 +128,10 @@ class DraggableSwitchButtonState extends State { key: const Key("draggableSwitchButtonSwitch"), onHorizontalDragStart: (_) => _isDragging = true, onHorizontalDragUpdate: (details) { - valueListener.value = (valueListener.value + - details.delta.dx / constraint.maxWidth) - .clamp(0.0, 1.0); + valueListener.value = + (valueListener.value + + details.delta.dx / constraint.maxWidth) + .clamp(0.0, 1.0); }, onHorizontalDragEnd: (details) { final bool oldValue = _isOn; @@ -172,8 +175,9 @@ class DraggableSwitchButtonState extends State { animation: valueListener, builder: (context, child) { return AnimatedAlign( - duration: - _isDragging ? Duration.zero : tapAnimationDuration, + duration: _isDragging + ? Duration.zero + : tapAnimationDuration, alignment: Alignment(valueListener.value * 2 - 1, 0.5), child: child, ); diff --git a/lib/widgets/custom_buttons/dropdown_button.dart b/lib/widgets/custom_buttons/dropdown_button.dart index b2044376ab..b7ce28d627 100644 --- a/lib/widgets/custom_buttons/dropdown_button.dart +++ b/lib/widgets/custom_buttons/dropdown_button.dart @@ -262,11 +262,7 @@ class _JDropdownIconButtonState extends State> { ), ), onPressed: _isOpen ? close : open, - child: SvgPicture.asset( - Assets.svg.list, - width: 20, - height: 20, - ), + child: SvgPicture.asset(Assets.svg.list, width: 20, height: 20), ), ); } @@ -299,7 +295,7 @@ class _JDropdownButtonMenuState extends State<_JDropdownButtonMenu> { child: Stack( children: [ Container( - color: Colors.black.withOpacity(0.2), + color: Colors.black.withValues(alpha: 0.2), // child: widget.content, ), Positioned( @@ -315,13 +311,9 @@ class _JDropdownButtonMenuState extends State<_JDropdownButtonMenu> { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), ...widget.items, - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), ], ), ), diff --git a/lib/widgets/custom_pin_put/pin_keyboard.dart b/lib/widgets/custom_pin_put/pin_keyboard.dart index 9eb44ae4da..ef8cb21c77 100644 --- a/lib/widgets/custom_pin_put/pin_keyboard.dart +++ b/lib/widgets/custom_pin_put/pin_keyboard.dart @@ -18,11 +18,7 @@ import '../../utilities/assets.dart'; import '../../utilities/text_styles.dart'; class NumberKey extends StatefulWidget { - const NumberKey({ - super.key, - required this.number, - required this.onPressed, - }); + const NumberKey({super.key, required this.number, required this.onPressed}); final String number; final ValueSetter onPressed; @@ -69,7 +65,7 @@ class _NumberKeyState extends State { _color = Theme.of(context) .extension()! .numberBackDefault - .withOpacity(0.8); + .withValues(alpha: 0.8); }); Future.delayed(const Duration(milliseconds: 200), () { @@ -83,10 +79,7 @@ class _NumberKeyState extends State { }); }, child: Center( - child: Text( - number, - style: STextStyles.numberDefault(context), - ), + child: Text(number, style: STextStyles.numberDefault(context)), ), ), ); @@ -94,10 +87,7 @@ class _NumberKeyState extends State { } class BackspaceKey extends StatefulWidget { - const BackspaceKey({ - super.key, - required this.onPressed, - }); + const BackspaceKey({super.key, required this.onPressed}); final VoidCallback onPressed; @@ -139,7 +129,7 @@ class _BackspaceKeyState extends State { _color = Theme.of(context) .extension()! .numpadBackDefault - .withOpacity(0.8); + .withValues(alpha: 0.8); }); Future.delayed(const Duration(milliseconds: 200), () { @@ -160,8 +150,9 @@ class _BackspaceKeyState extends State { Assets.svg.delete, width: 20, height: 20, - color: - Theme.of(context).extension()!.numpadTextDefault, + color: Theme.of(context) + .extension()! + .numpadTextDefault, ), ), ), @@ -171,10 +162,7 @@ class _BackspaceKeyState extends State { } class SubmitKey extends StatelessWidget { - const SubmitKey({ - super.key, - required this.onPressed, - }); + const SubmitKey({super.key, required this.onPressed}); final VoidCallback onPressed; @@ -200,8 +188,9 @@ class SubmitKey extends StatelessWidget { Assets.svg.arrowRight, width: 20, height: 20, - color: - Theme.of(context).extension()!.numpadTextDefault, + color: Theme.of(context) + .extension()! + .numpadTextDefault, ), ), ), @@ -296,18 +285,7 @@ class PinKeyboard extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final list = [ - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "0", - ]; + final list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]; // final isRandom = ref.read(prefsChangeNotifierProvider).randomizePIN; @@ -321,97 +299,41 @@ class PinKeyboard extends ConsumerWidget { children: [ Row( children: [ - NumberKey( - number: list[0], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[1], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[2], - onPressed: _numberHandler, - ), + NumberKey(number: list[0], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[1], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[2], onPressed: _numberHandler), ], ), - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), Row( children: [ - NumberKey( - number: list[3], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[4], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[5], - onPressed: _numberHandler, - ), + NumberKey(number: list[3], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[4], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[5], onPressed: _numberHandler), ], ), - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), Row( children: [ - NumberKey( - number: list[6], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[7], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[8], - onPressed: _numberHandler, - ), + NumberKey(number: list[6], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[7], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[8], onPressed: _numberHandler), ], ), - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), Row( children: [ - BackspaceKey( - onPressed: _backHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[9], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - SubmitKey( - onPressed: _submitHandler, - ), + BackspaceKey(onPressed: _backHandler), + const SizedBox(width: 24), + NumberKey(number: list[9], onPressed: _numberHandler), + const SizedBox(width: 24), + SubmitKey(onPressed: _submitHandler), ], ), ], @@ -456,18 +378,7 @@ class RandomKeyboard extends StatelessWidget { @override Widget build(BuildContext context) { - final list = [ - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "0", - ]; + final list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]; list.shuffle(); return Container( width: width, @@ -477,97 +388,41 @@ class RandomKeyboard extends StatelessWidget { children: [ Row( children: [ - NumberKey( - number: list[0], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[1], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[2], - onPressed: _numberHandler, - ), + NumberKey(number: list[0], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[1], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[2], onPressed: _numberHandler), ], ), - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), Row( children: [ - NumberKey( - number: list[3], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[4], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[5], - onPressed: _numberHandler, - ), + NumberKey(number: list[3], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[4], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[5], onPressed: _numberHandler), ], ), - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), Row( children: [ - NumberKey( - number: list[6], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[7], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[8], - onPressed: _numberHandler, - ), + NumberKey(number: list[6], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[7], onPressed: _numberHandler), + const SizedBox(width: 24), + NumberKey(number: list[8], onPressed: _numberHandler), ], ), - const SizedBox( - height: 24, - ), + const SizedBox(height: 24), Row( children: [ - BackspaceKey( - onPressed: _backHandler, - ), - const SizedBox( - width: 24, - ), - NumberKey( - number: list[9], - onPressed: _numberHandler, - ), - const SizedBox( - width: 24, - ), - SubmitKey( - onPressed: _submitHandler, - ), + BackspaceKey(onPressed: _backHandler), + const SizedBox(width: 24), + NumberKey(number: list[9], onPressed: _numberHandler), + const SizedBox(width: 24), + SubmitKey(onPressed: _submitHandler), ], ), ], diff --git a/lib/widgets/date_picker/date_picker.dart b/lib/widgets/date_picker/date_picker.dart index 9655fe262f..b6e7a000f6 100644 --- a/lib/widgets/date_picker/date_picker.dart +++ b/lib/widgets/date_picker/date_picker.dart @@ -50,12 +50,13 @@ Future?> showSWDatePicker( calendarType: range ? .range : null, buttonPadding: const EdgeInsets.only(right: 16), centerAlignModePicker: true, - selectedDayHighlightColor: Theme.of( - context, - ).extension()!.accentColorDark, - daySplashColor: Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.6), + selectedDayHighlightColor: Theme.of(context) + .extension()! + .accentColorDark, + daySplashColor: Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.6), ), ); @@ -183,16 +184,16 @@ class StackDateRangePicker extends StatelessWidget { }, child: Container( decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), border: Border.all( - color: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, width: 1, ), ), @@ -207,9 +208,9 @@ class StackDateRangePicker extends StatelessWidget { Assets.svg.calendar, height: 20, width: 20, - color: Theme.of( - context, - ).extension()!.textSubtitle2, + color: Theme.of(context) + .extension()! + .textSubtitle2, ), const SizedBox(width: 10), Expanded( @@ -217,12 +218,12 @@ class StackDateRangePicker extends StatelessWidget { fromDateString.isEmpty ? "From..." : fromDateString, style: STextStyles.fieldLabel(context).copyWith( color: fromDateString.isEmpty - ? Theme.of( - context, - ).extension()!.textSubtitle2 - : Theme.of( - context, - ).extension()!.accentColorDark, + ? Theme.of(context) + .extension()! + .textSubtitle2 + : Theme.of(context) + .extension()! + .accentColorDark, ), ), ), @@ -278,16 +279,16 @@ class StackDateRangePicker extends StatelessWidget { }, child: Container( decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), border: Border.all( - color: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, width: 1, ), ), @@ -302,9 +303,9 @@ class StackDateRangePicker extends StatelessWidget { Assets.svg.calendar, height: 20, width: 20, - color: Theme.of( - context, - ).extension()!.textSubtitle2, + color: Theme.of(context) + .extension()! + .textSubtitle2, ), const SizedBox(width: 10), Expanded( @@ -312,12 +313,12 @@ class StackDateRangePicker extends StatelessWidget { toDateString.isEmpty ? "To..." : toDateString, style: STextStyles.fieldLabel(context).copyWith( color: toDateString.isEmpty - ? Theme.of( - context, - ).extension()!.textSubtitle2 - : Theme.of( - context, - ).extension()!.accentColorDark, + ? Theme.of(context) + .extension()! + .textSubtitle2 + : Theme.of(context) + .extension()! + .accentColorDark, ), ), ), diff --git a/lib/widgets/epicbox_card.dart b/lib/widgets/epicbox_card.dart index ca80683e81..25792eef1d 100644 --- a/lib/widgets/epicbox_card.dart +++ b/lib/widgets/epicbox_card.dart @@ -107,18 +107,18 @@ class _EpicBoxCardState extends ConsumerState { status = "Testing..."; } else if (_testResult == true) { status = isPrimary ? "Connected" : "Reachable"; - statusColor = Theme.of( - context, - ).extension()!.accentColorGreen; + statusColor = Theme.of(context) + .extension()! + .accentColorGreen; } else if (_testResult == false) { status = "Unreachable"; statusColor = Theme.of(context).extension()!.accentColorRed; } else { status = isPrimary ? "Selected" : ""; if (isPrimary) { - statusColor = Theme.of( - context, - ).extension()!.accentColorBlue; + statusColor = Theme.of(context) + .extension()! + .accentColorBlue; } } @@ -142,13 +142,13 @@ class _EpicBoxCardState extends ConsumerState { height: isDesktop ? 40 : 24, decoration: BoxDecoration( color: epicBox.isDefault - ? Theme.of( - context, - ).extension()!.buttonBackSecondary + ? Theme.of(context) + .extension()! + .buttonBackSecondary : Theme.of(context) .extension()! .infoItemIcons - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(100), ), child: Center( @@ -157,12 +157,12 @@ class _EpicBoxCardState extends ConsumerState { height: isDesktop ? 18 : 11, width: isDesktop ? 20 : 14, color: epicBox.isDefault - ? Theme.of( - context, - ).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.infoItemIcons, + ? Theme.of(context) + .extension()! + .accentColorDark + : Theme.of(context) + .extension()! + .infoItemIcons, ), ), ), @@ -191,9 +191,9 @@ class _EpicBoxCardState extends ConsumerState { : Assets.svg.chevronDown, width: 12, height: 6, - color: Theme.of( - context, - ).extension()!.textSubtitle1, + color: Theme.of(context) + .extension()! + .textSubtitle1, ), ], ), diff --git a/lib/widgets/frost_scaffold.dart b/lib/widgets/frost_scaffold.dart index 9a527eb57f..599c654dc3 100644 --- a/lib/widgets/frost_scaffold.dart +++ b/lib/widgets/frost_scaffold.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; + import '../frost_route_generator.dart'; import '../themes/stack_colors.dart'; import '../utilities/text_styles.dart'; @@ -57,28 +58,23 @@ class _FrostScaffoldState extends ConsumerState { label: "No", onPressed: () { // pop dialog - Navigator.of( - context, - rootNavigator: Util.isDesktop, - ).pop("no"); + Navigator.of(context, rootNavigator: Util.isDesktop).pop("no"); }, ), rightButton: PrimaryButton( label: "Yes", onPressed: () { // pop dialog - Navigator.of( - context, - rootNavigator: Util.isDesktop, - ).pop("yes"); + Navigator.of(context, rootNavigator: Util.isDesktop).pop("yes"); }, ), ), ); // make sure to at least delay some time otherwise flutter pops back more than a single route lol... - final minTimeFuture = - Future.delayed(const Duration(milliseconds: 200)); + final minTimeFuture = Future.delayed( + const Duration(milliseconds: 200), + ); final result = await Future.wait([resultFuture, minTimeFuture]); @@ -109,11 +105,10 @@ class _FrostScaffoldState extends ConsumerState { condition: !Util.isDesktop, builder: (child) => Background( child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, - body: SafeArea( - child: child, - ), + backgroundColor: Theme.of(context) + .extension()! + .background, + body: SafeArea(child: child), ), ), child: Column( @@ -122,9 +117,7 @@ class _FrostScaffoldState extends ConsumerState { SizedBox( height: 56, child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16, - ), + padding: const EdgeInsets.symmetric(horizontal: 16), child: Row( children: [ Text( @@ -136,21 +129,16 @@ class _FrostScaffoldState extends ConsumerState { .customTextButtonEnabledText, ), ), - const SizedBox( - width: 10, - ), + const SizedBox(width: 10), Expanded( child: Text( _routes[ref.watch(pFrostCreateCurrentStep) - 1] .title, - style: STextStyles.navBarTitle(context).copyWith( - fontSize: _titleTextSize, - ), + style: STextStyles.navBarTitle(context) + .copyWith(fontSize: _titleTextSize), ), ), - const SizedBox( - width: 10, - ), + const SizedBox(width: 10), CustomTextButton( text: "Exit", textSize: _titleTextSize, @@ -170,7 +158,7 @@ class _FrostScaffoldState extends ConsumerState { backgroundColor: Theme.of(context) .extension()! .customTextButtonEnabledText - .withOpacity(0.1), + .withValues(alpha: 0.1), percent: ref.watch(pFrostCreateCurrentStep) / _routes.length, ), @@ -181,12 +169,7 @@ class _FrostScaffoldState extends ConsumerState { builder: (child) => Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Flexible( - child: SizedBox( - width: 500, - child: child, - ), - ), + Flexible(child: SizedBox(width: 500, child: child)), ], ), child: ConditionalParent( @@ -198,9 +181,7 @@ class _FrostScaffoldState extends ConsumerState { constraints: BoxConstraints( minHeight: constraints.maxHeight, ), - child: IntrinsicHeight( - child: child, - ), + child: IntrinsicHeight(child: child), ), ); }, diff --git a/lib/widgets/icon_widgets/utxo_status_icon.dart b/lib/widgets/icon_widgets/utxo_status_icon.dart index 30a39b1fc7..4a28f1eb07 100644 --- a/lib/widgets/icon_widgets/utxo_status_icon.dart +++ b/lib/widgets/icon_widgets/utxo_status_icon.dart @@ -10,15 +10,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; + import '../../themes/stack_colors.dart'; import '../../utilities/assets.dart'; import '../conditional_parent.dart'; import '../rounded_container.dart'; -enum UTXOStatusIconStatus { - confirmed, - unconfirmed; -} +enum UTXOStatusIconStatus { confirmed, unconfirmed } class UTXOStatusIcon extends StatelessWidget { const UTXOStatusIcon({ @@ -82,8 +80,8 @@ class UTXOStatusIcon extends StatelessWidget { color: selected ? Theme.of(context).extension()!.infoItemIcons : blocked - ? _blockedColor.withOpacity(0.3) - : _availableColor.withOpacity(0.2), + ? _blockedColor.withValues(alpha: 0.3) + : _availableColor.withValues(alpha: 0.2), width: width, height: height, ), @@ -91,15 +89,15 @@ class UTXOStatusIcon extends StatelessWidget { selected ? Assets.svg.coinControl.selected : blocked - ? Assets.svg.coinControl.blocked - : Assets.svg.coinControl.unBlocked, + ? Assets.svg.coinControl.blocked + : Assets.svg.coinControl.unBlocked, width: 20, height: 20, color: selected ? Colors.white : blocked - ? _blockedColor - : _availableColor, + ? _blockedColor + : _availableColor, ), ], ), diff --git a/lib/widgets/managed_favorite.dart b/lib/widgets/managed_favorite.dart index c89bc483b2..dd8ae260a3 100644 --- a/lib/widgets/managed_favorite.dart +++ b/lib/widgets/managed_favorite.dart @@ -13,6 +13,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; + import '../providers/db/main_db_provider.dart'; import '../themes/coin_icon_provider.dart'; import '../themes/stack_colors.dart'; @@ -28,10 +29,7 @@ import 'custom_buttons/favorite_toggle.dart'; import 'rounded_white_container.dart'; class ManagedFavorite extends ConsumerStatefulWidget { - const ManagedFavorite({ - super.key, - required this.walletId, - }); + const ManagedFavorite({super.key, required this.walletId}); final String walletId; @@ -54,7 +52,7 @@ class _ManagedFavoriteCardState extends ConsumerState { if (coin is Firo) { final balancePrivate = ref.watch(pWalletBalanceSecondary(walletId)).total + - ref.watch(pWalletBalanceTertiary(walletId)).total; + ref.watch(pWalletBalanceTertiary(walletId)).total; total += balancePrivate; } @@ -65,7 +63,9 @@ class _ManagedFavoriteCardState extends ConsumerState { padding: EdgeInsets.all(isDesktop ? 0 : 4.0), child: RawMaterialButton( onPressed: () { - ref.read(pWalletInfo(walletId)).updateIsFavourite( + ref + .read(pWalletInfo(walletId)) + .updateIsFavourite( !isFavourite, isar: ref.read(mainDBProvider).isar, ); @@ -77,16 +77,13 @@ class _ManagedFavoriteCardState extends ConsumerState { ), child: Padding( padding: isDesktop - ? const EdgeInsets.symmetric( - horizontal: 20, - vertical: 12, - ) + ? const EdgeInsets.symmetric(horizontal: 20, vertical: 12) : const EdgeInsets.all(8), child: Row( children: [ Container( decoration: BoxDecoration( - color: ref.watch(pCoinColor(coin)).withOpacity(0.5), + color: ref.watch(pCoinColor(coin)).withValues(alpha: 0.5), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -94,17 +91,13 @@ class _ManagedFavoriteCardState extends ConsumerState { child: Padding( padding: EdgeInsets.all(isDesktop ? 6 : 4), child: SvgPicture.file( - File( - ref.watch(coinIconProvider(coin)), - ), + File(ref.watch(coinIconProvider(coin))), width: 20, height: 20, ), ), ), - const SizedBox( - width: 12, - ), + const SizedBox(width: 12), if (isDesktop) Expanded( child: Row( @@ -117,11 +110,7 @@ class _ManagedFavoriteCardState extends ConsumerState { ), Expanded( child: Text( - ref - .watch( - pAmountFormatter(coin), - ) - .format(total), + ref.watch(pAmountFormatter(coin)).format(total), style: STextStyles.itemSubtitle(context), ), ), @@ -129,16 +118,16 @@ class _ManagedFavoriteCardState extends ConsumerState { isFavourite ? "Remove from favorites" : "Add to favorites", - style: - STextStyles.desktopTextExtraSmall(context).copyWith( - color: isFavourite - ? Theme.of(context) - .extension()! - .accentColorRed - : Theme.of(context) - .extension()! - .buttonTextBorderless, - ), + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: isFavourite + ? Theme.of(context) + .extension()! + .accentColorRed + : Theme.of(context) + .extension()! + .buttonTextBorderless, + ), ), ], ), @@ -153,15 +142,9 @@ class _ManagedFavoriteCardState extends ConsumerState { ref.watch(pWalletName(walletId)), style: STextStyles.titleBold12(context), ), - const SizedBox( - height: 2, - ), + const SizedBox(height: 2), Text( - ref - .watch( - pAmountFormatter(coin), - ) - .format(total), + ref.watch(pAmountFormatter(coin)).format(total), style: STextStyles.itemSubtitle(context), ), ], diff --git a/lib/widgets/node_card.dart b/lib/widgets/node_card.dart index 7d7a829698..ba7dac1d8b 100644 --- a/lib/widgets/node_card.dart +++ b/lib/widgets/node_card.dart @@ -251,13 +251,13 @@ class _NodeCardState extends ConsumerState { height: isDesktop ? 40 : 24, decoration: BoxDecoration( color: _node.id.startsWith(DefaultNodes.defaultNodeIdPrefix) - ? Theme.of( - context, - ).extension()!.buttonBackSecondary + ? Theme.of(context) + .extension()! + .buttonBackSecondary : Theme.of(context) .extension()! .infoItemIcons - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(100), ), child: Center( @@ -267,12 +267,12 @@ class _NodeCardState extends ConsumerState { width: isDesktop ? 20 : 14, color: _node.id.startsWith(DefaultNodes.defaultNodeIdPrefix) - ? Theme.of( - context, - ).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.infoItemIcons, + ? Theme.of(context) + .extension()! + .accentColorDark + : Theme.of(context) + .extension()! + .infoItemIcons, ), ), ), @@ -290,12 +290,12 @@ class _NodeCardState extends ConsumerState { SvgPicture.asset( Assets.svg.network, color: _status == "Connected" - ? Theme.of( - context, - ).extension()!.accentColorGreen - : Theme.of( - context, - ).extension()!.buttonBackSecondary, + ? Theme.of(context) + .extension()! + .accentColorGreen + : Theme.of(context) + .extension()! + .buttonBackSecondary, width: 20, height: 20, ), @@ -306,9 +306,9 @@ class _NodeCardState extends ConsumerState { : Assets.svg.chevronDown, width: 12, height: 6, - color: Theme.of( - context, - ).extension()!.textSubtitle1, + color: Theme.of(context) + .extension()! + .textSubtitle1, ), ], ), diff --git a/lib/widgets/node_options_sheet.dart b/lib/widgets/node_options_sheet.dart index 201b802cbe..ec60bd9341 100644 --- a/lib/widgets/node_options_sheet.dart +++ b/lib/widgets/node_options_sheet.dart @@ -121,9 +121,9 @@ class NodeOptionsSheet extends ConsumerWidget { Center( child: Container( decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.textFieldDefaultBG, + color: Theme.of(context) + .extension()! + .textFieldDefaultBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -150,13 +150,13 @@ class NodeOptionsSheet extends ConsumerWidget { node.id.startsWith( DefaultNodes.defaultNodeIdPrefix, ) - ? Theme.of( - context, - ).extension()!.textSubtitle4 + ? Theme.of(context) + .extension()! + .textSubtitle4 : Theme.of(context) .extension()! .infoItemIcons - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(100), ), child: Center( @@ -168,12 +168,12 @@ class NodeOptionsSheet extends ConsumerWidget { node.id.startsWith( DefaultNodes.defaultNodeIdPrefix, ) - ? Theme.of( - context, - ).extension()!.accentColorDark - : Theme.of( - context, - ).extension()!.infoItemIcons, + ? Theme.of(context) + .extension()! + .accentColorDark + : Theme.of(context) + .extension()! + .infoItemIcons, ), ), ), @@ -193,12 +193,12 @@ class NodeOptionsSheet extends ConsumerWidget { SvgPicture.asset( Assets.svg.network, color: status == "Connected" - ? Theme.of( - context, - ).extension()!.accentColorGreen - : Theme.of( - context, - ).extension()!.buttonBackSecondary, + ? Theme.of(context) + .extension()! + .accentColorGreen + : Theme.of(context) + .extension()! + .buttonBackSecondary, width: 18, ), ], @@ -222,9 +222,9 @@ class NodeOptionsSheet extends ConsumerWidget { child: Text( "Details", style: STextStyles.button(context).copyWith( - color: Theme.of( - context, - ).extension()!.accentColorDark, + color: Theme.of(context) + .extension()! + .accentColorDark, ), ), ), diff --git a/lib/widgets/toggle.dart b/lib/widgets/toggle.dart index eec7cec4cb..8e26f61975 100644 --- a/lib/widgets/toggle.dart +++ b/lib/widgets/toggle.dart @@ -68,14 +68,14 @@ class ToggleState extends State { // Color _colorBG(bool isOn, double alpha) { // return Color.alphaBlend( - // onColor.withOpacity(alpha), + // onColor.withValues(alpha: alpha), // offColor, // ); // } // Color _colorFG(bool isOn, double alpha) { // return Color.alphaBlend( - // onColor.withOpacity(alpha), + // onColor.withValues(alpha: alpha), // offColor, // ); // } @@ -126,9 +126,7 @@ class ToggleState extends State { duration: tapAnimationDuration, height: constraint.maxHeight, width: constraint.maxWidth, - decoration: decoration?.copyWith( - color: offColor, - ), + decoration: decoration?.copyWith(color: offColor), ); }, ), @@ -138,9 +136,10 @@ class ToggleState extends State { key: const Key("draggableSwitchButtonSwitch"), onHorizontalDragStart: (_) => _isDragging = true, onHorizontalDragUpdate: (details) { - valueListener.value = (valueListener.value + - details.delta.dx / constraint.maxWidth) - .clamp(0.0, 1.0); + valueListener.value = + (valueListener.value + + details.delta.dx / constraint.maxWidth) + .clamp(0.0, 1.0); }, onHorizontalDragEnd: (details) { final bool oldValue = _isOn; @@ -177,8 +176,9 @@ class ToggleState extends State { animation: valueListener, builder: (context, child) { return AnimatedAlign( - duration: - _isDragging ? Duration.zero : tapAnimationDuration, + duration: _isDragging + ? Duration.zero + : tapAnimationDuration, alignment: Alignment(valueListener.value * 2 - 1, 0.5), child: child, ); @@ -204,24 +204,21 @@ class ToggleState extends State { height: 14, color: isDesktop ? !_isOn - ? Theme.of(context) - .extension()! - .accentColorBlue - : Theme.of(context) - .extension()! - .buttonTextSecondary + ? Theme.of(context) + .extension()! + .accentColorBlue + : Theme.of(context) + .extension()! + .buttonTextSecondary : !_isOn - ? Theme.of(context) - .extension()! - .textDark - : Theme.of(context) - .extension()! - .textSubtitle1, - ), - if (widget.onIcon != null) - const SizedBox( - width: 5, + ? Theme.of(context) + .extension()! + .textDark + : Theme.of(context) + .extension()! + .textSubtitle1, ), + if (widget.onIcon != null) const SizedBox(width: 5), Text( widget.onText ?? "", style: isDesktop @@ -230,20 +227,20 @@ class ToggleState extends State { ).copyWith( color: !_isOn ? Theme.of(context) - .extension()! - .accentColorBlue + .extension()! + .accentColorBlue : Theme.of(context) - .extension()! - .buttonTextSecondary, + .extension()! + .buttonTextSecondary, ) : STextStyles.smallMed12(context).copyWith( color: !_isOn ? Theme.of(context) - .extension()! - .textDark + .extension()! + .textDark : Theme.of(context) - .extension()! - .textSubtitle1, + .extension()! + .textSubtitle1, ), ), ], @@ -263,24 +260,22 @@ class ToggleState extends State { height: 14, color: isDesktop ? _isOn - ? Theme.of(context) - .extension()! - .accentColorBlue - : Theme.of(context) - .extension()! - .buttonTextSecondary + ? Theme.of(context) + .extension()! + .accentColorBlue + : Theme.of(context) + .extension()! + .buttonTextSecondary : _isOn - ? Theme.of(context) - .extension()! - .textDark - : Theme.of(context) - .extension()! - .textSubtitle1, + ? Theme.of(context) + .extension()! + .textDark + : Theme.of(context) + .extension()! + .textSubtitle1, ), if (widget.offIcon != null) - const SizedBox( - width: 5, - ), + const SizedBox(width: 5), Text( widget.offText ?? "", style: isDesktop @@ -289,20 +284,20 @@ class ToggleState extends State { ).copyWith( color: _isOn ? Theme.of(context) - .extension()! - .accentColorBlue + .extension()! + .accentColorBlue : Theme.of(context) - .extension()! - .buttonTextSecondary, + .extension()! + .buttonTextSecondary, ) : STextStyles.smallMed12(context).copyWith( color: _isOn ? Theme.of(context) - .extension()! - .textDark + .extension()! + .textDark : Theme.of(context) - .extension()! - .textSubtitle1, + .extension()! + .textSubtitle1, ), ), ], diff --git a/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart b/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart index e341a23ea1..be44d3cb90 100644 --- a/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart +++ b/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart @@ -77,7 +77,7 @@ class _WalletInfoCoinIconState extends ConsumerState { width: widget.size, height: widget.size, decoration: BoxDecoration( - color: ref.watch(pCoinColor(widget.coin)).withOpacity(0.4), + color: ref.watch(pCoinColor(widget.coin)).withValues(alpha: 0.4), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), diff --git a/lib/widgets/wallet_navigation_bar/components/icons/finalize_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/finalize_nav_icon.dart index 04b19d2135..7b61e7ae48 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/finalize_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/finalize_nav_icon.dart @@ -21,9 +21,10 @@ class FinalizeNavIcon extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - color: Theme.of( - context, - ).extension()!.bottomNavIconIcon.withOpacity(0.4), + color: Theme.of(context) + .extension()! + .bottomNavIconIcon + .withValues(alpha: 0.4), borderRadius: BorderRadius.circular(24), ), child: Padding( diff --git a/lib/widgets/wallet_navigation_bar/components/icons/frost_sign_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/frost_sign_nav_icon.dart index e9fb99e956..eddfb563be 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/frost_sign_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/frost_sign_nav_icon.dart @@ -11,6 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; + import '../../../../themes/stack_colors.dart'; import '../../../../utilities/assets.dart'; @@ -24,10 +25,8 @@ class FrostSignNavIcon extends ConsumerWidget { color: Theme.of(context) .extension()! .bottomNavIconIcon - .withOpacity(0.4), - borderRadius: BorderRadius.circular( - 24, - ), + .withValues(alpha: 0.4), + borderRadius: BorderRadius.circular(24), ), child: Padding( padding: const EdgeInsets.all(6.0), diff --git a/lib/widgets/wallet_navigation_bar/components/icons/receive_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/receive_nav_icon.dart index bfd10f9003..9a50336fba 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/receive_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/receive_nav_icon.dart @@ -10,6 +10,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; + import '../../../../themes/stack_colors.dart'; import '../../../../utilities/assets.dart'; @@ -23,10 +24,8 @@ class ReceiveNavIcon extends StatelessWidget { color: Theme.of(context) .extension()! .bottomNavIconIcon - .withOpacity(0.4), - borderRadius: BorderRadius.circular( - 24, - ), + .withValues(alpha: 0.4), + borderRadius: BorderRadius.circular(24), ), child: Padding( padding: const EdgeInsets.all(6.0), diff --git a/lib/widgets/wallet_navigation_bar/components/icons/send_nav_icon.dart b/lib/widgets/wallet_navigation_bar/components/icons/send_nav_icon.dart index 64d0f861f9..b479e772be 100644 --- a/lib/widgets/wallet_navigation_bar/components/icons/send_nav_icon.dart +++ b/lib/widgets/wallet_navigation_bar/components/icons/send_nav_icon.dart @@ -10,6 +10,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; + import '../../../../themes/stack_colors.dart'; import '../../../../utilities/assets.dart'; @@ -23,10 +24,8 @@ class SendNavIcon extends StatelessWidget { color: Theme.of(context) .extension()! .bottomNavIconIcon - .withOpacity(0.4), - borderRadius: BorderRadius.circular( - 24, - ), + .withValues(alpha: 0.4), + borderRadius: BorderRadius.circular(24), ), child: Padding( padding: const EdgeInsets.all(6.0), diff --git a/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart b/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart index 8c93a1c748..530f31f59b 100644 --- a/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart +++ b/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart @@ -11,6 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; + import '../../themes/stack_colors.dart'; import '../../utilities/assets.dart'; import '../../utilities/text_styles.dart'; @@ -40,8 +41,9 @@ class _WalletNavigationBarState extends ConsumerState { final _moreDuration = const Duration(milliseconds: 200); void _onMorePressed() { - ref.read(walletNavBarMore.state).state = - !ref.read(walletNavBarMore.state).state; + ref.read(walletNavBarMore.state).state = !ref + .read(walletNavBarMore.state) + .state; } @override @@ -65,9 +67,7 @@ class _WalletNavigationBarState extends ConsumerState { child: AnimatedOpacity( opacity: ref.watch(walletNavBarMore.state).state ? 1 : 0, duration: _moreDuration, - child: Container( - color: Colors.black.withOpacity(0.7), - ), + child: Container(color: Colors.black.withValues(alpha: 0.7)), ), ), ), @@ -87,10 +87,7 @@ class _WalletNavigationBarState extends ConsumerState { AnimatedScale( scale: ref.watch(walletNavBarMore.state).state ? 1 : 0, duration: _moreDuration, - alignment: const Alignment( - 0.5, - 1.0, - ), + alignment: const Alignment(0.5, 1.0), child: AnimatedOpacity( opacity: ref.watch(walletNavBarMore.state).state ? 1 : 0, duration: _moreDuration, @@ -99,18 +96,14 @@ class _WalletNavigationBarState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisSize: MainAxisSize.min, children: [ - ...widget.moreItems.map( - (e) { - return Column( - children: [ - WalletNavigationBarMoreItem(data: e), - const SizedBox( - height: 8, - ), - ], - ); - }, - ), + ...widget.moreItems.map((e) { + return Column( + children: [ + WalletNavigationBarMoreItem(data: e), + const SizedBox(height: 8), + ], + ); + }), ], ), ), @@ -119,9 +112,7 @@ class _WalletNavigationBarState extends ConsumerState { Material( color: Colors.transparent, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - 1000, - ), + borderRadius: BorderRadius.circular(1000), ), child: Container( decoration: BoxDecoration( @@ -133,9 +124,7 @@ class _WalletNavigationBarState extends ConsumerState { .extension()! .standardBoxShadow, ], - borderRadius: BorderRadius.circular( - 1000, - ), + borderRadius: BorderRadius.circular(1000), ), child: Padding( padding: const EdgeInsets.symmetric( @@ -145,10 +134,8 @@ class _WalletNavigationBarState extends ConsumerState { // child: IntrinsicWidth( child: ConditionalParent( condition: buttonCount > 4, - builder: (child) => SizedBox( - width: width * 0.9, - child: child, - ), + builder: (child) => + SizedBox(width: width * 0.9, child: child), child: ConditionalParent( condition: buttonCount <= 4, builder: (child) => SizedBox( @@ -187,7 +174,8 @@ class _WalletNavigationBarState extends ConsumerState { .extension()! .bottomNavIconIconHighlighted, ), - crossFadeState: ref + crossFadeState: + ref .watch(walletNavBarMore.state) .state ? CrossFadeState.showSecond @@ -198,24 +186,27 @@ class _WalletNavigationBarState extends ConsumerState { firstChild: Text( "More", style: - STextStyles.buttonSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .bottomNavText, - ), + STextStyles.buttonSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .bottomNavText, + ), ), secondChild: Text( "More", style: - STextStyles.buttonSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .bottomNavIconIconHighlighted, - ), + STextStyles.buttonSmall( + context, + ).copyWith( + color: Theme.of(context) + .extension()! + .bottomNavIconIconHighlighted, + ), ), - crossFadeState: ref + crossFadeState: + ref .watch(walletNavBarMore.state) .state ? CrossFadeState.showSecond