From 51f974de7fca39b06c83368726118625557e4647 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 25 Aug 2026 12:17:05 -0500 Subject: [PATCH 1/4] style: dart format the files that still call withOpacity Formatter output only, no semantic change. 29 of these 52 files predate the current formatter; normalising them first keeps the deprecation migration that follows a purely mechanical diff, and the CI format gate checks every .dart file a PR touches. --- .../exchange_currency_selection_view.dart | 217 ++++++------- .../exchange_loading_overlay.dart | 69 ++--- .../exchange_step_views/step_3_view.dart | 65 ++-- lib/pages/exchange_view/exchange_view.dart | 32 +- .../wallet_initiated_exchange_view.dart | 5 +- .../paynym/subwidgets/paynym_card_button.dart | 45 ++- lib/pages/receive_view/receive_view.dart | 3 +- .../sub_widgets/mwc_slatepack_dialog.dart | 45 ++- .../startup_wallet_selection_view.dart | 16 +- .../wallet_syncing_options_view.dart | 46 +-- .../sub_widgets/token_summary_sol.dart | 92 +++--- .../sub_widgets/wallet_summary_info.dart | 67 ++-- .../desktop_exchange_view.dart | 51 +-- .../desktop_exchange_steps_indicator.dart | 151 ++++----- .../sub_widgets/desktop_receive.dart | 19 +- .../sub_widgets/network_info_button.dart | 110 ++++--- lib/utilities/text_styles.dart | 2 +- .../draggable_switch_button.dart | 12 +- .../custom_buttons/dropdown_button.dart | 26 +- lib/widgets/custom_pin_put/pin_keyboard.dart | 293 +++++------------- lib/widgets/frost_scaffold.dart | 59 ++-- .../icon_widgets/utxo_status_icon.dart | 17 +- lib/widgets/managed_favorite.dart | 60 ++-- lib/widgets/toggle.dart | 109 ++++--- .../wallet_info_row_coin_icon.dart | 35 +-- .../components/icons/frost_sign_nav_icon.dart | 11 +- .../components/icons/receive_nav_icon.dart | 11 +- .../components/icons/send_nav_icon.dart | 11 +- .../wallet_navigation_bar.dart | 92 +++--- 29 files changed, 735 insertions(+), 1036 deletions(-) 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 4a539ec9d4..219d33575b 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 @@ -73,19 +73,18 @@ class _ExchangeCurrencySelectionViewState showDialog( context: context, barrierDismissible: false, - builder: - (_) => WillPopScope( - onWillPop: () async => false, - child: Container( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(0.6), - child: const CustomLoadingOverlay( - message: "Loading currencies", - eventBus: null, - ), - ), + builder: (_) => WillPopScope( + onWillPop: () async => false, + child: Container( + color: Theme.of( + context, + ).extension()!.overlay.withOpacity(0.6), + child: const CustomLoadingOverlay( + message: "Loading currencies", + eventBus: null, ), + ), + ), ), ); @@ -101,36 +100,33 @@ class _ExchangeCurrencySelectionViewState Future> _loadCurrencies() async { await ExchangeDataLoadingService.instance.initDB(); final isar = await ExchangeDataLoadingService.instance.isar; - final currencies = - await isar.currencies - .where() - .filter() - .isFiatEqualTo(false) - .and() - .group( - (q) => - widget.isFixedRate - ? q - .rateTypeEqualTo(SupportedRateType.both) - .or() - .rateTypeEqualTo(SupportedRateType.fixed) - : q - .rateTypeEqualTo(SupportedRateType.both) - .or() - .rateTypeEqualTo(SupportedRateType.estimated), - ) - .sortByIsStackCoin() - .thenByName() - .findAll(); + final currencies = await isar.currencies + .where() + .filter() + .isFiatEqualTo(false) + .and() + .group( + (q) => widget.isFixedRate + ? q + .rateTypeEqualTo(SupportedRateType.both) + .or() + .rateTypeEqualTo(SupportedRateType.fixed) + : q + .rateTypeEqualTo(SupportedRateType.both) + .or() + .rateTypeEqualTo(SupportedRateType.estimated), + ) + .sortByIsStackCoin() + .thenByName() + .findAll(); // If using Tor, filter exchanges which do not support Tor. if (Prefs.instance.useTor) { if (Exchange.exchangeNamesWithTorSupport.isNotEmpty) { currencies.removeWhere( - (element) => - !Exchange.exchangeNamesWithTorSupport.contains( - element.exchangeName, - ), + (element) => !Exchange.exchangeNamesWithTorSupport.contains( + element.exchangeName, + ), ); } } @@ -163,20 +159,18 @@ class _ExchangeCurrencySelectionViewState results.remove(widget.pairedCurrency); } - final walletCoins = - results - .where( - (currency) => - AppConfig.coins - .where( - (coin) => - coin.ticker.toLowerCase() == - currency.ticker.toLowerCase() && - currency.fuzzyNet == coin.ticker.toLowerCase(), - ) - .isNotEmpty, - ) - .toList(); + final walletCoins = results + .where( + (currency) => AppConfig.coins + .where( + (coin) => + coin.ticker.toLowerCase() == + currency.ticker.toLowerCase() && + currency.fuzzyNet == coin.ticker.toLowerCase(), + ) + .isNotEmpty, + ) + .toList(); final list = results.toList(); @@ -240,8 +234,9 @@ class _ExchangeCurrencySelectionViewState builder: (child) { return Background( child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of( + context, + ).extension()!.background, appBar: AppBar( leading: AppBarBackButton( onPressed: () async { @@ -286,45 +281,45 @@ class _ExchangeCurrencySelectionViewState focusNode: _searchFocusNode, onChanged: (value) => setState(() => _searchString = value), style: STextStyles.field(context), - decoration: standardInputDecoration( - "Search", - _searchFocusNode, - context, - desktopMed: isDesktop, - ).copyWith( - prefixIcon: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, - vertical: 16, - ), - child: SvgPicture.asset( - Assets.svg.search, - width: 16, - height: 16, - ), - ), - suffixIcon: - _searchController.text.isNotEmpty + decoration: + standardInputDecoration( + "Search", + _searchFocusNode, + context, + desktopMed: isDesktop, + ).copyWith( + prefixIcon: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 16, + ), + child: SvgPicture.asset( + Assets.svg.search, + width: 16, + height: 16, + ), + ), + suffixIcon: _searchController.text.isNotEmpty ? Padding( - padding: const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - _searchController.text = ""; - _searchString = ""; - }); - }, - ), - ], + padding: const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + _searchController.text = ""; + _searchString = ""; + }); + }, + ), + ], + ), ), - ), - ) + ) : null, - ), + ), ), ), const SizedBox(height: 20), @@ -358,23 +353,20 @@ class _ExchangeCurrencySelectionViewState height: 24, child: AppConfig.isStackCoin( - items[index].ticker, - ) - ? CoinIconForTicker( - ticker: items[index].ticker, - size: 24, - ) - : hasImageUrl - ? _NetImage( - url: image, - key: ValueKey( - image + items[index].fuzzyNet, - ), - ) - : const SizedBox( - width: 24, - height: 24, + items[index].ticker, + ) + ? CoinIconForTicker( + ticker: items[index].ticker, + size: 24, + ) + : hasImageUrl + ? _NetImage( + url: image, + key: ValueKey( + image + items[index].fuzzyNet, ), + ) + : const SizedBox(width: 24, height: 24), ), const SizedBox(width: 10), Expanded( @@ -399,9 +391,8 @@ class _ExchangeCurrencySelectionViewState left: 12, ), child: CoinTickerTag( - ticker: - items[index].fuzzyNet - .toUpperCase(), + ticker: items[index].fuzzyNet + .toUpperCase(), ), ), ], @@ -409,14 +400,12 @@ class _ExchangeCurrencySelectionViewState const SizedBox(height: 2), Text( items[index].ticker.toUpperCase(), - style: STextStyles.smallMed12( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.smallMed12(context) + .copyWith( + color: Theme.of(context) .extension()! .textSubtitle1, - ), + ), ), ], ), diff --git a/lib/pages/exchange_view/exchange_loading_overlay.dart b/lib/pages/exchange_view/exchange_loading_overlay.dart index 5ccf12cf49..bac3afa796 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,34 +51,35 @@ 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: [ if (_statusEst == ChangeNowLoadStatus.loading || (_statusFixed == ChangeNowLoadStatus.loading && userReloaded)) Container( - color: Theme.of(context) - .extension()! - .overlay - .withOpacity(0.7), + color: Theme.of( + context, + ).extension()!.overlay.withOpacity(0.7), child: const CustomLoadingOverlay( message: "Loading Exchange data", eventBus: null, @@ -90,10 +90,9 @@ class _ExchangeLoadingOverlayViewState _statusEst != ChangeNowLoadStatus.loading && _statusFixed != ChangeNowLoadStatus.loading) Container( - color: Theme.of(context) - .extension()! - .overlay - .withOpacity(0.7), + color: Theme.of( + context, + ).extension()!.overlay.withOpacity(0.7), child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -108,9 +107,9 @@ class _ExchangeLoadingOverlayViewState child: Text( "OK", style: STextStyles.button(context).copyWith( - color: Theme.of(context) - .extension()! - .buttonTextSecondary, + color: Theme.of( + context, + ).extension()!.buttonTextSecondary, ), ), onPressed: () { 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 4f0b352c3c..71f27d68c5 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 @@ -205,14 +205,12 @@ class _Step3ViewState extends ConsumerState { ), child: Text( "Back", - style: STextStyles.button( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.button(context) + .copyWith( + color: Theme.of(context) .extension()! .buttonTextSecondary, - ), + ), ), ), ), @@ -224,22 +222,19 @@ class _Step3ViewState extends ConsumerState { showDialog( context: context, barrierDismissible: false, - builder: - (_) => WillPopScope( - onWillPop: () async => false, - child: Container( - color: Theme.of(context) - .extension()! - .overlay - .withOpacity(0.6), - child: - const CustomLoadingOverlay( - message: - "Creating a trade", - eventBus: null, - ), - ), + builder: (_) => WillPopScope( + onWillPop: () async => false, + child: Container( + color: Theme.of(context) + .extension()! + .overlay + .withOpacity(0.6), + child: const CustomLoadingOverlay( + message: "Creating a trade", + eventBus: null, ), + ), + ), ), ); @@ -256,16 +251,14 @@ class _Step3ViewState extends ConsumerState { fixedRate: model.rateType != ExchangeRateType.estimated, - amount: - model.reversed - ? model.receiveAmount - : model.sendAmount, + amount: model.reversed + ? model.receiveAmount + : model.sendAmount, addressTo: model.recipientAddress!, extraId: null, - addressRefund: - supportsRefund - ? model.refundAddress! - : "", + addressRefund: supportsRefund + ? model.refundAddress! + : "", refundExtraId: "", estimate: model.estimate, reversed: model.reversed, @@ -278,8 +271,8 @@ class _Step3ViewState extends ConsumerState { // TODO: better errors String? message; if (response.exception != null) { - message = - response.exception!.toString(); + message = response.exception! + .toString(); if (message.startsWith( "FormatException:", ) && @@ -293,12 +286,10 @@ class _Step3ViewState extends ConsumerState { showDialog( context: context, barrierDismissible: true, - builder: - (_) => StackDialog( - title: - "Failed to create trade", - message: message ?? "", - ), + builder: (_) => StackDialog( + title: "Failed to create trade", + message: message ?? "", + ), ), ); } diff --git a/lib/pages/exchange_view/exchange_view.dart b/lib/pages/exchange_view/exchange_view.dart index 276f7e73fa..f08746d3be 100644 --- a/lib/pages/exchange_view/exchange_view.dart +++ b/lib/pages/exchange_view/exchange_view.dart @@ -151,10 +151,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 +172,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 +196,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 +239,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/wallet_initiated_exchange_view.dart b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart index a2ffe26db3..a730346200 100644 --- a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart +++ b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart @@ -125,8 +125,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..38e97db9d4 100644 --- a/lib/pages/paynym/subwidgets/paynym_card_button.dart +++ b/lib/pages/paynym/subwidgets/paynym_card_button.dart @@ -44,16 +44,16 @@ 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) + ? Theme.of( + context, + ).extension()!.accentColorDark.withOpacity(0.08) : Colors.transparent, child: RawMaterialButton( padding: const EdgeInsets.all(0), @@ -79,20 +79,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, @@ -100,25 +92,24 @@ class _PaynymCardButtonState extends ConsumerState { Text( widget.accountLite.nymName, style: isDesktop - ? STextStyles.desktopTextExtraExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textFieldActiveText, + ? STextStyles.desktopTextExtraExtraSmall( + context, + ).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 ? STextStyles.desktopTextExtraExtraSmall(context) : STextStyles.w500_14(context).copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + color: Theme.of( + context, + ).extension()!.textSubtitle1, ), ), ], diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index 61f8ae5fbe..f0978425e6 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( 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..ad4ee62f14 100644 --- a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart +++ b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart @@ -57,35 +57,35 @@ 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: [ @@ -174,10 +174,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)), 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..a576d05c11 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 @@ -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..0138dfd9e1 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( @@ -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/token_view/sub_widgets/token_summary_sol.dart b/lib/pages/token_view/sub_widgets/token_summary_sol.dart index 9d627c1f58..e4cccd7e4e 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; @@ -125,7 +121,9 @@ 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, @@ -133,9 +131,7 @@ class SolanaTokenSummary extends ConsumerWidget { ), ), const SizedBox(width: 10), - CoinTickerTag( - ticker: tokenWallet.tokenSymbol, - ), + CoinTickerTag(ticker: tokenWallet.tokenSymbol), ], ), if (price != null) const SizedBox(height: 6), @@ -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,31 @@ 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.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, + ), ), ), ), @@ -304,10 +297,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..84a703ef81 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, ), @@ -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/desktop_exchange/desktop_exchange_view.dart b/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart index d0d0fda659..e8948e8bbd 100644 --- a/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart +++ b/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart @@ -86,10 +86,9 @@ class _DesktopExchangeViewState extends ConsumerState { children: [ child, Material( - color: Theme.of(context) - .extension()! - .overlay - .withOpacity(0.6), + color: Theme.of( + context, + ).extension()!.overlay.withOpacity(0.6), child: const CustomLoadingOverlay( message: "Updating exchange data", subMessage: "This could take a few minutes", @@ -103,21 +102,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 +118,23 @@ 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 +142,7 @@ class _DesktopExchangeViewState extends ConsumerState { ), ], ), - const SizedBox( - height: 16, - ), + const SizedBox(height: 16), Expanded( child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -170,16 +157,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/subwidgets/desktop_exchange_steps_indicator.dart b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_exchange_steps_indicator.dart index c8d4ba9ff8..81b4d383a3 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 @@ -20,10 +20,9 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { Color getColor(BuildContext context, int step) { if (currentStep >= step) { - return Theme.of(context) - .extension()! - .accentColorBlue - .withOpacity(0.5); + return Theme.of( + context, + ).extension()!.accentColorBlue.withOpacity(0.5); } else { return Theme.of(context).extension()!.textSubtitle3; } @@ -50,31 +49,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 + .withOpacity(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 +80,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { ], ), ), - const SizedBox( - width: horizontalSpacing, - ), + const SizedBox(width: horizontalSpacing), SizedBox( width: width, child: Column( @@ -93,32 +88,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 + .withOpacity(0.5), + ), ), crossFadeState: currentStep == 2 && currentStep > 1 ? CrossFadeState.showFirst @@ -130,9 +125,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 +134,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { ], ), ), - const SizedBox( - width: horizontalSpacing, - ), + const SizedBox(width: horizontalSpacing), SizedBox( width: width, child: Column( @@ -151,32 +142,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 + .withOpacity(0.5), + ), ), crossFadeState: currentStep == 3 && currentStep > 2 ? CrossFadeState.showFirst @@ -188,9 +179,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 +188,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { ], ), ), - const SizedBox( - width: horizontalSpacing, - ), + const SizedBox(width: horizontalSpacing), SizedBox( width: width, child: Column( @@ -209,30 +196,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( @@ -244,9 +229,9 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { offset: Offset(dy, 0), duration: duration, child: RoundedContainer( - color: Theme.of(context) - .extension()! - .accentColorBlue, + color: Theme.of( + context, + ).extension()!.accentColorBlue, height: barHeight, width: double.infinity, ), 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..4cd6eb6ab6 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( @@ -605,9 +604,11 @@ class _DesktopReceiveState extends ConsumerState { ), ), ), - 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( @@ -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: [ @@ -909,7 +911,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 +920,9 @@ class _DesktopReceiveState extends ConsumerState { label: "Receive Slatepack", enabled: _slateToggleFlag, onPressed: _slateToggleFlag - ? (isEpiccash ? _onEpicReceiveSlatePressed : _onReceiveSlatePressed) + ? (isEpiccash + ? _onEpicReceiveSlatePressed + : _onReceiveSlatePressed) : null, ), ) 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..bb32b58e4c 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; @@ -212,66 +213,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/text_styles.dart b/lib/utilities/text_styles.dart index 2337a66222..2e9c08f90c 100644 --- a/lib/utilities/text_styles.dart +++ b/lib/utilities/text_styles.dart @@ -467,7 +467,7 @@ class STextStyles { } } -// Desktop + // Desktop static TextStyle desktopH1(BuildContext context) { switch (_theme(context).themeId) { diff --git a/lib/widgets/custom_buttons/draggable_switch_button.dart b/lib/widgets/custom_buttons/draggable_switch_button.dart index e0ea21ebf1..369de22765 100644 --- a/lib/widgets/custom_buttons/draggable_switch_button.dart +++ b/lib/widgets/custom_buttons/draggable_switch_button.dart @@ -126,9 +126,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 +173,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..8bcd07fc7f 100644 --- a/lib/widgets/custom_buttons/dropdown_button.dart +++ b/lib/widgets/custom_buttons/dropdown_button.dart @@ -120,9 +120,9 @@ class _JDropdownButtonState extends State> { icon: SvgPicture.asset( Assets.svg.chevronDown, width: 10, - color: Theme.of(context) - .extension()! - .buttonTextSecondary, + color: Theme.of( + context, + ).extension()!.buttonTextSecondary, ), curve: Curves.easeInOutCubic, controller: _rotateIconController, @@ -250,9 +250,9 @@ class _JDropdownIconButtonState extends State> { shape: MaterialStateProperty.all( RoundedRectangleBorder( side: BorderSide( - color: Theme.of(context) - .extension()! - .buttonBackBorderSecondary, + color: Theme.of( + context, + ).extension()!.buttonBackBorderSecondary, width: 1, ), borderRadius: BorderRadius.circular( @@ -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), ), ); } @@ -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..0695189d14 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; @@ -66,27 +62,23 @@ class _NumberKeyState extends State { onPressed: () async { onPressed.call(number); setState(() { - _color = Theme.of(context) - .extension()! - .numberBackDefault - .withOpacity(0.8); + _color = Theme.of( + context, + ).extension()!.numberBackDefault.withOpacity(0.8); }); Future.delayed(const Duration(milliseconds: 200), () { if (mounted) { setState(() { - _color = Theme.of(context) - .extension()! - .numberBackDefault; + _color = Theme.of( + context, + ).extension()!.numberBackDefault; }); } }); }, child: Center( - child: Text( - number, - style: STextStyles.numberDefault(context), - ), + child: Text(number, style: STextStyles.numberDefault(context)), ), ), ); @@ -94,10 +86,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; @@ -136,18 +125,17 @@ class _BackspaceKeyState extends State { onPressed: () { onPressed.call(); setState(() { - _color = Theme.of(context) - .extension()! - .numpadBackDefault - .withOpacity(0.8); + _color = Theme.of( + context, + ).extension()!.numpadBackDefault.withOpacity(0.8); }); Future.delayed(const Duration(milliseconds: 200), () { if (mounted) { setState(() { - _color = Theme.of(context) - .extension()! - .numpadBackDefault; + _color = Theme.of( + context, + ).extension()!.numpadBackDefault; }); } }); @@ -160,8 +148,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 +160,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 +186,9 @@ class SubmitKey extends StatelessWidget { Assets.svg.arrowRight, width: 20, height: 20, - color: - Theme.of(context).extension()!.numpadTextDefault, + color: Theme.of( + context, + ).extension()!.numpadTextDefault, ), ), ), @@ -248,9 +235,9 @@ class CustomKey extends StatelessWidget { iconAssetName!, width: 20, height: 20, - color: Theme.of(context) - .extension()! - .numpadTextDefault, + color: Theme.of( + context, + ).extension()!.numpadTextDefault, ), ), ), @@ -296,18 +283,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 +297,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 +376,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 +386,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/frost_scaffold.dart b/lib/widgets/frost_scaffold.dart index 9a527eb57f..575bb2a669 100644 --- a/lib/widgets/frost_scaffold.dart +++ b/lib/widgets/frost_scaffold.dart @@ -57,28 +57,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 +104,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 +116,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 +128,17 @@ 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, @@ -164,9 +152,9 @@ class _FrostScaffoldState extends ConsumerState { builder: (subContext, constraints) => ProgressBar( width: constraints.maxWidth, height: 3, - fillColor: Theme.of(context) - .extension()! - .customTextButtonEnabledText, + fillColor: Theme.of( + context, + ).extension()!.customTextButtonEnabledText, backgroundColor: Theme.of(context) .extension()! .customTextButtonEnabledText @@ -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..f9a312b152 100644 --- a/lib/widgets/icon_widgets/utxo_status_icon.dart +++ b/lib/widgets/icon_widgets/utxo_status_icon.dart @@ -15,10 +15,7 @@ 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 +79,8 @@ class UTXOStatusIcon extends StatelessWidget { color: selected ? Theme.of(context).extension()!.infoItemIcons : blocked - ? _blockedColor.withOpacity(0.3) - : _availableColor.withOpacity(0.2), + ? _blockedColor.withOpacity(0.3) + : _availableColor.withOpacity(0.2), width: width, height: height, ), @@ -91,15 +88,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..9da23184f9 100644 --- a/lib/widgets/managed_favorite.dart +++ b/lib/widgets/managed_favorite.dart @@ -28,10 +28,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 +51,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 +62,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,10 +76,7 @@ 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: [ @@ -94,17 +90,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 +109,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 +117,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 +141,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/toggle.dart b/lib/widgets/toggle.dart index eec7cec4cb..a6da20af9c 100644 --- a/lib/widgets/toggle.dart +++ b/lib/widgets/toggle.dart @@ -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 + ? Theme.of( + context, + ).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 + ? Theme.of( + context, + ).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 e5450c39ad..6386d720a3 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 @@ -48,18 +48,14 @@ class _WalletInfoCoinIconState extends ConsumerState { ExchangeDataLoadingService.instance.isar.then((isar) async { if (widget.contractAddress != null) { - final currency = - await isar.currencies - .where() - .exchangeNameEqualTo(ChangeNowExchange.exchangeName) - .filter() - .tokenContractEqualTo( - widget.contractAddress!, - caseSensitive: false, - ) - .and() - .imageIsNotEmpty() - .findFirst(); + final currency = await isar.currencies + .where() + .exchangeNameEqualTo(ChangeNowExchange.exchangeName) + .filter() + .tokenContractEqualTo(widget.contractAddress!, caseSensitive: false) + .and() + .imageIsNotEmpty() + .findFirst(); if (mounted) { WidgetsBinding.instance.addPostFrameCallback((_) { @@ -87,14 +83,13 @@ class _WalletInfoCoinIconState extends ConsumerState { ), child: Padding( padding: EdgeInsets.all(widget.size / 5), - child: - imageUrl != null && imageUrl!.isNotEmpty - ? SvgPicture.network(imageUrl!, width: 20, height: 20) - : SvgPicture.file( - File(ref.watch(coinIconProvider(widget.coin))), - width: 20, - height: 20, - ), + child: imageUrl != null && imageUrl!.isNotEmpty + ? SvgPicture.network(imageUrl!, width: 20, height: 20) + : SvgPicture.file( + File(ref.watch(coinIconProvider(widget.coin))), + width: 20, + height: 20, + ), ), ); } 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..8076cca81f 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 @@ -21,13 +21,10 @@ class FrostSignNavIcon extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { return Container( decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .bottomNavIconIcon - .withOpacity(0.4), - borderRadius: BorderRadius.circular( - 24, - ), + color: Theme.of( + context, + ).extension()!.bottomNavIconIcon.withOpacity(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..add8934ffd 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 @@ -20,13 +20,10 @@ class ReceiveNavIcon extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .bottomNavIconIcon - .withOpacity(0.4), - borderRadius: BorderRadius.circular( - 24, - ), + color: Theme.of( + context, + ).extension()!.bottomNavIconIcon.withOpacity(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..d6242fff2c 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 @@ -20,13 +20,10 @@ class SendNavIcon extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .bottomNavIconIcon - .withOpacity(0.4), - borderRadius: BorderRadius.circular( - 24, - ), + color: Theme.of( + context, + ).extension()!.bottomNavIconIcon.withOpacity(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..14ddeaa830 100644 --- a/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart +++ b/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart @@ -40,8 +40,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 +66,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.withOpacity(0.7)), ), ), ), @@ -87,10 +86,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 +95,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,23 +111,19 @@ class _WalletNavigationBarState extends ConsumerState { Material( color: Colors.transparent, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - 1000, - ), + borderRadius: BorderRadius.circular(1000), ), child: Container( decoration: BoxDecoration( - color: Theme.of(context) - .extension()! - .bottomNavBack, + color: Theme.of( + context, + ).extension()!.bottomNavBack, boxShadow: [ - Theme.of(context) - .extension()! - .standardBoxShadow, + Theme.of( + context, + ).extension()!.standardBoxShadow, ], - borderRadius: BorderRadius.circular( - 1000, - ), + borderRadius: BorderRadius.circular(1000), ), child: Padding( padding: const EdgeInsets.symmetric( @@ -145,10 +133,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 +173,8 @@ class _WalletNavigationBarState extends ConsumerState { .extension()! .bottomNavIconIconHighlighted, ), - crossFadeState: ref + crossFadeState: + ref .watch(walletNavBarMore.state) .state ? CrossFadeState.showSecond @@ -198,24 +185,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 From a4d12bca0804af085645edc4b3ef5372f425b1bd Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 25 Aug 2026 12:17:21 -0500 Subject: [PATCH 2/4] refactor: migrate deprecated .withOpacity() to .withValues(alpha:) `Color.withOpacity` is deprecated in the pinned Flutter SDK. `withValues` stores alpha as a double instead of quantising it to 8 bits; `toARGB32()` rounds to the same byte for every alpha, so nothing renders differently. 83 call sites in 52 files. Reproducible from the preceding commit: substitute `.withOpacity(X)` -> `.withValues(alpha: X)` and run `dart format`, which rewraps the 12 sites (10 files) where the longer name no longer fits the line. --- .../notification_card_layout.dart | 4 ++- lib/pages/buy_view/buy_form.dart | 4 +-- lib/pages/buy_view/buy_view.dart | 2 +- .../exchange_currency_selection_view.dart | 2 +- lib/pages/exchange_view/exchange_form.dart | 2 +- .../exchange_loading_overlay.dart | 4 +-- .../exchange_step_views/step_3_view.dart | 2 +- lib/pages/exchange_view/exchange_view.dart | 2 +- lib/pages/exchange_view/send_from_view.dart | 2 +- .../wallet_initiated_exchange_view.dart | 2 +- .../paynym/subwidgets/paynym_card_button.dart | 7 +++--- lib/pages/receive_view/receive_view.dart | 4 +-- .../sub_widgets/mwc_slatepack_dialog.dart | 2 +- .../stack_backup_views/auto_backup_view.dart | 11 ++++---- .../startup_wallet_selection_view.dart | 2 +- .../wallet_syncing_options_view.dart | 2 +- .../wallet_network_settings_view.dart | 15 +++++------ .../shopinbit/shopinbit_send_from_view.dart | 2 +- lib/pages/shopinbit/shopinbit_step_2.dart | 2 +- .../shopinbit/shopinbit_ticket_detail.dart | 6 ++--- .../shopinbit/shopinbit_tickets_view.dart | 2 +- .../token_view/sub_widgets/token_summary.dart | 7 +++--- .../sub_widgets/token_summary_sol.dart | 7 +++--- .../sub_widgets/wallet_summary_info.dart | 2 +- .../desktop_address_book.dart | 11 +++++--- .../desktop_buy/desktop_buy_view.dart | 2 +- .../desktop_exchange_view.dart | 2 +- .../exchange_steps/step_scaffold.dart | 2 +- .../desktop_exchange_steps_indicator.dart | 8 +++--- .../desktop_menu_item.dart | 25 ++++++++++--------- .../sub_widgets/desktop_receive.dart | 4 +-- .../sub_widgets/network_info_button.dart | 2 +- lib/utilities/show_loading.dart | 6 ++--- lib/utilities/text_styles.dart | 4 +-- .../custom_buttons/blue_text_button.dart | 4 +-- .../draggable_switch_button.dart | 4 +-- .../custom_buttons/dropdown_button.dart | 2 +- lib/widgets/custom_pin_put/pin_keyboard.dart | 14 ++++++----- lib/widgets/date_picker/date_picker.dart | 2 +- lib/widgets/epicbox_card.dart | 2 +- lib/widgets/frost_scaffold.dart | 2 +- .../icon_widgets/utxo_status_icon.dart | 4 +-- lib/widgets/managed_favorite.dart | 2 +- lib/widgets/node_card.dart | 2 +- lib/widgets/node_options_sheet.dart | 2 +- lib/widgets/toggle.dart | 4 +-- .../wallet_info_row_coin_icon.dart | 2 +- .../components/icons/finalize_nav_icon.dart | 2 +- .../components/icons/frost_sign_nav_icon.dart | 2 +- .../components/icons/receive_nav_icon.dart | 2 +- .../components/icons/send_nav_icon.dart | 2 +- .../wallet_navigation_bar.dart | 2 +- 52 files changed, 116 insertions(+), 103 deletions(-) diff --git a/lib/notifications/notification_card_layout.dart b/lib/notifications/notification_card_layout.dart index 44340ad245..89ecd87b9d 100644 --- a/lib/notifications/notification_card_layout.dart +++ b/lib/notifications/notification_card_layout.dart @@ -85,7 +85,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 93b64400d4..1377547ecc 100644 --- a/lib/pages/buy_view/buy_form.dart +++ b/lib/pages/buy_view/buy_form.dart @@ -840,7 +840,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, @@ -906,7 +906,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..cde107a2de 100644 --- a/lib/pages/buy_view/buy_view.dart +++ b/lib/pages/buy_view/buy_view.dart @@ -73,7 +73,7 @@ class _BuyViewState extends ConsumerState { Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.7), + ).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 219d33575b..a4e8e890d4 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 @@ -78,7 +78,7 @@ class _ExchangeCurrencySelectionViewState child: Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.6), + ).extension()!.overlay.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 c328e5e4f7..0713e7b6e4 100644 --- a/lib/pages/exchange_view/exchange_form.dart +++ b/lib/pages/exchange_view/exchange_form.dart @@ -117,7 +117,7 @@ class _ExchangeFormState extends ConsumerState { child: Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.6), + ).extension()!.overlay.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 bac3afa796..5ea55ac3c3 100644 --- a/lib/pages/exchange_view/exchange_loading_overlay.dart +++ b/lib/pages/exchange_view/exchange_loading_overlay.dart @@ -79,7 +79,7 @@ class _ExchangeLoadingOverlayViewState Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.7), + ).extension()!.overlay.withValues(alpha: 0.7), child: const CustomLoadingOverlay( message: "Loading Exchange data", eventBus: null, @@ -92,7 +92,7 @@ class _ExchangeLoadingOverlayViewState Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.7), + ).extension()!.overlay.withValues(alpha: 0.7), child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ 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 71f27d68c5..fdd1f7d9a0 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 @@ -228,7 +228,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 f08746d3be..6c9e227a32 100644 --- a/lib/pages/exchange_view/exchange_view.dart +++ b/lib/pages/exchange_view/exchange_view.dart @@ -96,7 +96,7 @@ class _ExchangeViewState extends ConsumerState { Material( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.6), + ).extension()!.overlay.withValues(alpha: 0.6), child: const CustomLoadingOverlay( message: "Updating exchange data", subMessage: "This could take a few minutes", diff --git a/lib/pages/exchange_view/send_from_view.dart b/lib/pages/exchange_view/send_from_view.dart index 1e3555c655..bfa896140b 100644 --- a/lib/pages/exchange_view/send_from_view.dart +++ b/lib/pages/exchange_view/send_from_view.dart @@ -566,7 +566,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 a730346200..e906322048 100644 --- a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart +++ b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart @@ -113,7 +113,7 @@ class _WalletInitiatedExchangeViewState Material( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.6), + ).extension()!.overlay.withValues(alpha: 0.6), child: const CustomLoadingOverlay( message: "Updating exchange data", subMessage: "This could take a few minutes", diff --git a/lib/pages/paynym/subwidgets/paynym_card_button.dart b/lib/pages/paynym/subwidgets/paynym_card_button.dart index 38e97db9d4..4c3a560866 100644 --- a/lib/pages/paynym/subwidgets/paynym_card_button.dart +++ b/lib/pages/paynym/subwidgets/paynym_card_button.dart @@ -51,9 +51,10 @@ class _PaynymCardButtonState extends ConsumerState { .state ?.nymId == widget.accountLite.nymId - ? Theme.of( - context, - ).extension()!.accentColorDark.withOpacity(0.08) + ? Theme.of(context) + .extension()! + .accentColorDark + .withValues(alpha: 0.08) : Colors.transparent, child: RawMaterialButton( padding: const EdgeInsets.all(0), diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index f0978425e6..2a1a4f0a35 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -227,7 +227,7 @@ class _ReceiveViewState extends ConsumerState { child: Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.5), + ).extension()!.overlay.withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, @@ -309,7 +309,7 @@ class _ReceiveViewState extends ConsumerState { child: Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.5), + ).extension()!.overlay.withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, 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 ad4ee62f14..d043900e50 100644 --- a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart +++ b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart @@ -117,7 +117,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( 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..642c1c4ce8 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 @@ -369,7 +369,7 @@ class _AutoBackupViewState extends ConsumerState { color: Theme.of(context) .extension()! .textDark - .withOpacity(0.5), + .withValues(alpha: 0.5), ), readOnly: true, enableSuggestions: false, @@ -401,7 +401,7 @@ class _AutoBackupViewState extends ConsumerState { color: Theme.of(context) .extension()! .textDark - .withOpacity(0.5), + .withValues(alpha: 0.5), ), obscureText: true, enableSuggestions: false, @@ -432,9 +432,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, 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 a576d05c11..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 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 0138dfd9e1..e8f6a9b51b 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 @@ -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, ), 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..e9cd63e795 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 @@ -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( @@ -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( @@ -701,7 +701,7 @@ class _WalletNetworkSettingsViewState color: Theme.of(context) .extension()! .accentColorRed - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(_iconSize), ), child: Center( @@ -849,7 +849,7 @@ class _WalletNetworkSettingsViewState color: Theme.of(context) .extension()! .accentColorGreen - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(_iconSize), ), child: Center( @@ -870,9 +870,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( diff --git a/lib/pages/shopinbit/shopinbit_send_from_view.dart b/lib/pages/shopinbit/shopinbit_send_from_view.dart index fb54b1f41b..57f91e30a2 100644 --- a/lib/pages/shopinbit/shopinbit_send_from_view.dart +++ b/lib/pages/shopinbit/shopinbit_send_from_view.dart @@ -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..6078bf8c04 100644 --- a/lib/pages/shopinbit/shopinbit_step_2.dart +++ b/lib/pages/shopinbit/shopinbit_step_2.dart @@ -237,7 +237,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( diff --git a/lib/pages/shopinbit/shopinbit_ticket_detail.dart b/lib/pages/shopinbit/shopinbit_ticket_detail.dart index 2a558ef5dc..88708ae620 100644 --- a/lib/pages/shopinbit/shopinbit_ticket_detail.dart +++ b/lib/pages/shopinbit/shopinbit_ticket_detail.dart @@ -394,7 +394,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, @@ -981,8 +981,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..ba0d347848 100644 --- a/lib/pages/shopinbit/shopinbit_tickets_view.dart +++ b/lib/pages/shopinbit/shopinbit_tickets_view.dart @@ -434,7 +434,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..49b9225864 100644 --- a/lib/pages/token_view/sub_widgets/token_summary.dart +++ b/lib/pages/token_view/sub_widgets/token_summary.dart @@ -283,9 +283,10 @@ 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), ), 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 e4cccd7e4e..c9950607d6 100644 --- a/lib/pages/token_view/sub_widgets/token_summary_sol.dart +++ b/lib/pages/token_view/sub_widgets/token_summary_sol.dart @@ -267,9 +267,10 @@ 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), ), 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 84a703ef81..3dcb9a3600 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart @@ -196,7 +196,7 @@ class WalletSummaryInfo extends ConsumerWidget { color: Theme.of(context) .extension()! .textFavoriteCard - .withOpacity(0.7), + .withValues(alpha: 0.7), ), ), ), 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 a4e767048b..ed4c76de90 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 @@ -355,8 +355,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, ), @@ -426,8 +428,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..fdb7435e31 100644 --- a/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart +++ b/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart @@ -100,7 +100,7 @@ class _DesktopBuyViewState extends ConsumerState { Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.7), + ).extension()!.overlay.withValues(alpha: 0.7), height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, child: DesktopDialog( 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 e8948e8bbd..69653bc43d 100644 --- a/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart +++ b/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart @@ -88,7 +88,7 @@ class _DesktopExchangeViewState extends ConsumerState { Material( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.6), + ).extension()!.overlay.withValues(alpha: 0.6), child: const CustomLoadingOverlay( message: "Updating exchange data", subMessage: "This could take a few minutes", 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 27d0b68a64..6fe59ec696 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 { child: Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.6), + ).extension()!.overlay.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 81b4d383a3..5b57a33c5c 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 @@ -22,7 +22,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { if (currentStep >= step) { return Theme.of( context, - ).extension()!.accentColorBlue.withOpacity(0.5); + ).extension()!.accentColorBlue.withValues(alpha: 0.5); } else { return Theme.of(context).extension()!.textSubtitle3; } @@ -63,7 +63,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { color: Theme.of(context) .extension()! .accentColorBlue - .withOpacity(0.5), + .withValues(alpha: 0.5), ), ), crossFadeState: currentStep == 1 @@ -112,7 +112,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { color: Theme.of(context) .extension()! .accentColorBlue - .withOpacity(0.5), + .withValues(alpha: 0.5), ), ), crossFadeState: currentStep == 2 && currentStep > 1 @@ -166,7 +166,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { color: Theme.of(context) .extension()! .accentColorBlue - .withOpacity(0.5), + .withValues(alpha: 0.5), ), ), crossFadeState: currentStep == 3 && currentStep > 2 diff --git a/lib/pages_desktop_specific/desktop_menu_item.dart b/lib/pages_desktop_specific/desktop_menu_item.dart index 60daf23ea8..185740b787 100644 --- a/lib/pages_desktop_specific/desktop_menu_item.dart +++ b/lib/pages_desktop_specific/desktop_menu_item.dart @@ -47,7 +47,7 @@ class DesktopMyStackIcon extends ConsumerWidget { ? Theme.of(context).extension()!.accentColorDark : Theme.of( context, - ).extension()!.accentColorDark.withOpacity(0.8), + ).extension()!.accentColorDark.withValues(alpha: 0.8), ); } } @@ -67,7 +67,7 @@ class DesktopExchangeIcon extends ConsumerWidget { ? Theme.of(context).extension()!.accentColorDark : Theme.of( context, - ).extension()!.accentColorDark.withOpacity(0.8), + ).extension()!.accentColorDark.withValues(alpha: 0.8), ); } } @@ -87,7 +87,7 @@ class DesktopBuyIcon extends ConsumerWidget { ? Theme.of(context).extension()!.accentColorDark : Theme.of( context, - ).extension()!.accentColorDark.withOpacity(0.8), + ).extension()!.accentColorDark.withValues(alpha: 0.8), ); } } @@ -107,7 +107,7 @@ class DesktopServicesIcon extends ConsumerWidget { ? Theme.of(context).extension()!.accentColorDark : Theme.of( context, - ).extension()!.accentColorDark.withOpacity(0.8), + ).extension()!.accentColorDark.withValues(alpha: 0.8), ); } } @@ -134,9 +134,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), ); } } @@ -156,7 +157,7 @@ class DesktopAddressBookIcon extends ConsumerWidget { ? Theme.of(context).extension()!.accentColorDark : Theme.of( context, - ).extension()!.accentColorDark.withOpacity(0.8), + ).extension()!.accentColorDark.withValues(alpha: 0.8), ); } } @@ -176,7 +177,7 @@ class DesktopSettingsIcon extends ConsumerWidget { ? Theme.of(context).extension()!.accentColorDark : Theme.of( context, - ).extension()!.accentColorDark.withOpacity(0.8), + ).extension()!.accentColorDark.withValues(alpha: 0.8), ); } } @@ -196,7 +197,7 @@ class DesktopSupportIcon extends ConsumerWidget { ? Theme.of(context).extension()!.accentColorDark : Theme.of( context, - ).extension()!.accentColorDark.withOpacity(0.8), + ).extension()!.accentColorDark.withValues(alpha: 0.8), ); } } @@ -216,7 +217,7 @@ class DesktopAboutIcon extends ConsumerWidget { ? Theme.of(context).extension()!.accentColorDark : Theme.of( context, - ).extension()!.accentColorDark.withOpacity(0.8), + ).extension()!.accentColorDark.withValues(alpha: 0.8), ); } } @@ -232,7 +233,7 @@ class DesktopExitIcon extends ConsumerWidget { height: 20, color: Theme.of( context, - ).extension()!.accentColorDark.withOpacity(0.8), + ).extension()!.accentColorDark.withValues(alpha: 0.8), ); } } 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 4cd6eb6ab6..f00707a5ed 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 @@ -245,7 +245,7 @@ class _DesktopReceiveState extends ConsumerState { child: Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.5), + ).extension()!.overlay.withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, @@ -324,7 +324,7 @@ class _DesktopReceiveState extends ConsumerState { child: Container( color: Theme.of( context, - ).extension()!.overlay.withOpacity(0.5), + ).extension()!.overlay.withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, 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 bb32b58e4c..ed3ed1ef05 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 @@ -166,7 +166,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) { diff --git a/lib/utilities/show_loading.dart b/lib/utilities/show_loading.dart index 39537e37d1..0d1521846f 100644 --- a/lib/utilities/show_loading.dart +++ b/lib/utilities/show_loading.dart @@ -46,9 +46,9 @@ 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 2e9c08f90c..3befeae676 100644 --- a/lib/utilities/text_styles.dart +++ b/lib/utilities/text_styles.dart @@ -718,7 +718,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 +742,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..dc693e1942 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, ), ), diff --git a/lib/widgets/custom_buttons/draggable_switch_button.dart b/lib/widgets/custom_buttons/draggable_switch_button.dart index 369de22765..7a1b66dbe4 100644 --- a/lib/widgets/custom_buttons/draggable_switch_button.dart +++ b/lib/widgets/custom_buttons/draggable_switch_button.dart @@ -50,7 +50,7 @@ class DraggableSwitchButtonState extends State { return Color.alphaBlend( Theme.of( context, - ).extension()!.switchBGOn.withOpacity(alpha), + ).extension()!.switchBGOn.withValues(alpha: alpha), Theme.of(context).extension()!.switchBGOff, ); } @@ -62,7 +62,7 @@ class DraggableSwitchButtonState extends State { return Color.alphaBlend( Theme.of( context, - ).extension()!.switchCircleOn.withOpacity(alpha), + ).extension()!.switchCircleOn.withValues(alpha: alpha), Theme.of(context).extension()!.switchCircleOff, ); } diff --git a/lib/widgets/custom_buttons/dropdown_button.dart b/lib/widgets/custom_buttons/dropdown_button.dart index 8bcd07fc7f..9ccb2193c0 100644 --- a/lib/widgets/custom_buttons/dropdown_button.dart +++ b/lib/widgets/custom_buttons/dropdown_button.dart @@ -295,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( diff --git a/lib/widgets/custom_pin_put/pin_keyboard.dart b/lib/widgets/custom_pin_put/pin_keyboard.dart index 0695189d14..f26b424b62 100644 --- a/lib/widgets/custom_pin_put/pin_keyboard.dart +++ b/lib/widgets/custom_pin_put/pin_keyboard.dart @@ -62,9 +62,10 @@ class _NumberKeyState extends State { onPressed: () async { onPressed.call(number); setState(() { - _color = Theme.of( - context, - ).extension()!.numberBackDefault.withOpacity(0.8); + _color = Theme.of(context) + .extension()! + .numberBackDefault + .withValues(alpha: 0.8); }); Future.delayed(const Duration(milliseconds: 200), () { @@ -125,9 +126,10 @@ class _BackspaceKeyState extends State { onPressed: () { onPressed.call(); setState(() { - _color = Theme.of( - context, - ).extension()!.numpadBackDefault.withOpacity(0.8); + _color = Theme.of(context) + .extension()! + .numpadBackDefault + .withValues(alpha: 0.8); }); Future.delayed(const Duration(milliseconds: 200), () { diff --git a/lib/widgets/date_picker/date_picker.dart b/lib/widgets/date_picker/date_picker.dart index 9655fe262f..d0562cc1ee 100644 --- a/lib/widgets/date_picker/date_picker.dart +++ b/lib/widgets/date_picker/date_picker.dart @@ -55,7 +55,7 @@ Future?> showSWDatePicker( ).extension()!.accentColorDark, daySplashColor: Theme.of( context, - ).extension()!.accentColorDark.withOpacity(0.6), + ).extension()!.accentColorDark.withValues(alpha: 0.6), ), ); diff --git a/lib/widgets/epicbox_card.dart b/lib/widgets/epicbox_card.dart index ca80683e81..09def4c8c9 100644 --- a/lib/widgets/epicbox_card.dart +++ b/lib/widgets/epicbox_card.dart @@ -148,7 +148,7 @@ class _EpicBoxCardState extends ConsumerState { : Theme.of(context) .extension()! .infoItemIcons - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(100), ), child: Center( diff --git a/lib/widgets/frost_scaffold.dart b/lib/widgets/frost_scaffold.dart index 575bb2a669..c250abbe26 100644 --- a/lib/widgets/frost_scaffold.dart +++ b/lib/widgets/frost_scaffold.dart @@ -158,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, ), diff --git a/lib/widgets/icon_widgets/utxo_status_icon.dart b/lib/widgets/icon_widgets/utxo_status_icon.dart index f9a312b152..296896f037 100644 --- a/lib/widgets/icon_widgets/utxo_status_icon.dart +++ b/lib/widgets/icon_widgets/utxo_status_icon.dart @@ -79,8 +79,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, ), diff --git a/lib/widgets/managed_favorite.dart b/lib/widgets/managed_favorite.dart index 9da23184f9..c84c9cb592 100644 --- a/lib/widgets/managed_favorite.dart +++ b/lib/widgets/managed_favorite.dart @@ -82,7 +82,7 @@ class _ManagedFavoriteCardState 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/widgets/node_card.dart b/lib/widgets/node_card.dart index 7d7a829698..16729efea3 100644 --- a/lib/widgets/node_card.dart +++ b/lib/widgets/node_card.dart @@ -257,7 +257,7 @@ class _NodeCardState extends ConsumerState { : Theme.of(context) .extension()! .infoItemIcons - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(100), ), child: Center( diff --git a/lib/widgets/node_options_sheet.dart b/lib/widgets/node_options_sheet.dart index 201b802cbe..eb67d9283d 100644 --- a/lib/widgets/node_options_sheet.dart +++ b/lib/widgets/node_options_sheet.dart @@ -156,7 +156,7 @@ class NodeOptionsSheet extends ConsumerWidget { : Theme.of(context) .extension()! .infoItemIcons - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(100), ), child: Center( diff --git a/lib/widgets/toggle.dart b/lib/widgets/toggle.dart index a6da20af9c..f56be5242b 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, // ); // } 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 6386d720a3..5cc75b3dd2 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 @@ -76,7 +76,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..2ab53c32de 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 @@ -23,7 +23,7 @@ class FinalizeNavIcon extends StatelessWidget { decoration: BoxDecoration( color: Theme.of( context, - ).extension()!.bottomNavIconIcon.withOpacity(0.4), + ).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 8076cca81f..96b63cb972 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 @@ -23,7 +23,7 @@ class FrostSignNavIcon extends ConsumerWidget { decoration: BoxDecoration( color: Theme.of( context, - ).extension()!.bottomNavIconIcon.withOpacity(0.4), + ).extension()!.bottomNavIconIcon.withValues(alpha: 0.4), borderRadius: BorderRadius.circular(24), ), child: Padding( 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 add8934ffd..bfa2428699 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 @@ -22,7 +22,7 @@ class ReceiveNavIcon extends StatelessWidget { decoration: BoxDecoration( color: Theme.of( context, - ).extension()!.bottomNavIconIcon.withOpacity(0.4), + ).extension()!.bottomNavIconIcon.withValues(alpha: 0.4), borderRadius: BorderRadius.circular(24), ), child: Padding( 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 d6242fff2c..265b576d3b 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 @@ -22,7 +22,7 @@ class SendNavIcon extends StatelessWidget { decoration: BoxDecoration( color: Theme.of( context, - ).extension()!.bottomNavIconIcon.withOpacity(0.4), + ).extension()!.bottomNavIconIcon.withValues(alpha: 0.4), borderRadius: BorderRadius.circular(24), ), child: Padding( diff --git a/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart b/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart index 14ddeaa830..e427730445 100644 --- a/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart +++ b/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart @@ -66,7 +66,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)), ), ), ), From b4453383085d4c05f75f84b691aa50e83343fd6c Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 6 Oct 2026 21:26:47 -0500 Subject: [PATCH 3/4] style: dart format files touched by withValues migration Formatter output only, no semantic change. Keeps the deprecation migration that follows a mechanical diff, since the CI format gate checks every .dart file a PR touches. --- .../notification_card_layout.dart | 10 +- lib/pages/buy_view/buy_view.dart | 7 +- .../exchange_currency_selection_view.dart | 218 +++++++-------- .../exchange_loading_overlay.dart | 52 ++-- lib/pages/exchange_view/exchange_view.dart | 39 ++- lib/pages/exchange_view/send_from_view.dart | 36 +-- .../wallet_initiated_exchange_view.dart | 12 +- .../paynym/subwidgets/paynym_card_button.dart | 38 +-- lib/pages/receive_view/receive_view.dart | 43 ++- .../sub_widgets/mwc_slatepack_dialog.dart | 55 ++-- .../stack_backup_views/auto_backup_view.dart | 74 +++-- .../startup_wallet_selection_view.dart | 16 +- .../wallet_syncing_options_view.dart | 46 +-- .../wallet_network_settings_view.dart | 156 +++++------ .../shopinbit/shopinbit_send_from_view.dart | 18 +- lib/pages/shopinbit/shopinbit_step_2.dart | 20 +- .../shopinbit/shopinbit_ticket_detail.dart | 35 ++- .../shopinbit/shopinbit_tickets_view.dart | 17 +- .../token_view/sub_widgets/token_summary.dart | 61 ++-- .../sub_widgets/token_summary_sol.dart | 117 ++++---- .../sub_widgets/wallet_summary_info.dart | 67 +++-- .../desktop_address_book.dart | 24 +- .../desktop_buy/desktop_buy_view.dart | 13 +- .../desktop_exchange_view.dart | 44 +-- .../desktop_exchange_steps_indicator.dart | 139 +++++----- .../desktop_menu_item.dart | 76 ++--- .../sub_widgets/desktop_receive.dart | 120 ++++---- .../sub_widgets/network_info_button.dart | 115 ++++---- lib/utilities/show_loading.dart | 7 +- lib/utilities/text_styles.dart | 3 +- .../custom_buttons/blue_text_button.dart | 17 +- .../draggable_switch_button.dart | 26 +- .../custom_buttons/dropdown_button.dart | 14 +- lib/widgets/custom_pin_put/pin_keyboard.dart | 261 ++++-------------- lib/widgets/date_picker/date_picker.dart | 73 ++--- lib/widgets/epicbox_card.dart | 36 +-- lib/widgets/frost_scaffold.dart | 53 ++-- .../icon_widgets/utxo_status_icon.dart | 18 +- lib/widgets/managed_favorite.dart | 61 ++-- lib/widgets/node_card.dart | 36 +-- lib/widgets/node_options_sheet.dart | 42 +-- lib/widgets/toggle.dart | 105 ++++--- .../wallet_info_row_coin_icon.dart | 35 +-- .../components/icons/finalize_nav_icon.dart | 7 +- .../components/icons/frost_sign_nav_icon.dart | 5 +- .../components/icons/receive_nav_icon.dart | 5 +- .../components/icons/send_nav_icon.dart | 5 +- .../wallet_navigation_bar.dart | 81 +++--- 48 files changed, 1146 insertions(+), 1412 deletions(-) diff --git a/lib/notifications/notification_card_layout.dart b/lib/notifications/notification_card_layout.dart index 44340ad245..ed5380bd75 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( diff --git a/lib/pages/buy_view/buy_view.dart b/lib/pages/buy_view/buy_view.dart index 552a8457ed..078b797dec 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 + .withOpacity(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 4a539ec9d4..9c400e1b53 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 @@ -73,19 +73,19 @@ class _ExchangeCurrencySelectionViewState showDialog( context: context, barrierDismissible: false, - builder: - (_) => WillPopScope( - onWillPop: () async => false, - child: Container( - color: Theme.of( - context, - ).extension()!.overlay.withOpacity(0.6), - child: const CustomLoadingOverlay( - message: "Loading currencies", - eventBus: null, - ), - ), + builder: (_) => WillPopScope( + onWillPop: () async => false, + child: Container( + color: Theme.of(context) + .extension()! + .overlay + .withOpacity(0.6), + child: const CustomLoadingOverlay( + message: "Loading currencies", + eventBus: null, ), + ), + ), ), ); @@ -101,36 +101,33 @@ class _ExchangeCurrencySelectionViewState Future> _loadCurrencies() async { await ExchangeDataLoadingService.instance.initDB(); final isar = await ExchangeDataLoadingService.instance.isar; - final currencies = - await isar.currencies - .where() - .filter() - .isFiatEqualTo(false) - .and() - .group( - (q) => - widget.isFixedRate - ? q - .rateTypeEqualTo(SupportedRateType.both) - .or() - .rateTypeEqualTo(SupportedRateType.fixed) - : q - .rateTypeEqualTo(SupportedRateType.both) - .or() - .rateTypeEqualTo(SupportedRateType.estimated), - ) - .sortByIsStackCoin() - .thenByName() - .findAll(); + final currencies = await isar.currencies + .where() + .filter() + .isFiatEqualTo(false) + .and() + .group( + (q) => widget.isFixedRate + ? q + .rateTypeEqualTo(SupportedRateType.both) + .or() + .rateTypeEqualTo(SupportedRateType.fixed) + : q + .rateTypeEqualTo(SupportedRateType.both) + .or() + .rateTypeEqualTo(SupportedRateType.estimated), + ) + .sortByIsStackCoin() + .thenByName() + .findAll(); // If using Tor, filter exchanges which do not support Tor. if (Prefs.instance.useTor) { if (Exchange.exchangeNamesWithTorSupport.isNotEmpty) { currencies.removeWhere( - (element) => - !Exchange.exchangeNamesWithTorSupport.contains( - element.exchangeName, - ), + (element) => !Exchange.exchangeNamesWithTorSupport.contains( + element.exchangeName, + ), ); } } @@ -163,20 +160,18 @@ class _ExchangeCurrencySelectionViewState results.remove(widget.pairedCurrency); } - final walletCoins = - results - .where( - (currency) => - AppConfig.coins - .where( - (coin) => - coin.ticker.toLowerCase() == - currency.ticker.toLowerCase() && - currency.fuzzyNet == coin.ticker.toLowerCase(), - ) - .isNotEmpty, - ) - .toList(); + final walletCoins = results + .where( + (currency) => AppConfig.coins + .where( + (coin) => + coin.ticker.toLowerCase() == + currency.ticker.toLowerCase() && + currency.fuzzyNet == coin.ticker.toLowerCase(), + ) + .isNotEmpty, + ) + .toList(); final list = results.toList(); @@ -240,8 +235,9 @@ class _ExchangeCurrencySelectionViewState builder: (child) { return Background( child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of(context) + .extension()! + .background, appBar: AppBar( leading: AppBarBackButton( onPressed: () async { @@ -286,45 +282,45 @@ class _ExchangeCurrencySelectionViewState focusNode: _searchFocusNode, onChanged: (value) => setState(() => _searchString = value), style: STextStyles.field(context), - decoration: standardInputDecoration( - "Search", - _searchFocusNode, - context, - desktopMed: isDesktop, - ).copyWith( - prefixIcon: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, - vertical: 16, - ), - child: SvgPicture.asset( - Assets.svg.search, - width: 16, - height: 16, - ), - ), - suffixIcon: - _searchController.text.isNotEmpty + decoration: + standardInputDecoration( + "Search", + _searchFocusNode, + context, + desktopMed: isDesktop, + ).copyWith( + prefixIcon: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 16, + ), + child: SvgPicture.asset( + Assets.svg.search, + width: 16, + height: 16, + ), + ), + suffixIcon: _searchController.text.isNotEmpty ? Padding( - padding: const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - _searchController.text = ""; - _searchString = ""; - }); - }, - ), - ], + padding: const EdgeInsets.only(right: 0), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + _searchController.text = ""; + _searchString = ""; + }); + }, + ), + ], + ), ), - ), - ) + ) : null, - ), + ), ), ), const SizedBox(height: 20), @@ -358,23 +354,20 @@ class _ExchangeCurrencySelectionViewState height: 24, child: AppConfig.isStackCoin( - items[index].ticker, - ) - ? CoinIconForTicker( - ticker: items[index].ticker, - size: 24, - ) - : hasImageUrl - ? _NetImage( - url: image, - key: ValueKey( - image + items[index].fuzzyNet, - ), - ) - : const SizedBox( - width: 24, - height: 24, + items[index].ticker, + ) + ? CoinIconForTicker( + ticker: items[index].ticker, + size: 24, + ) + : hasImageUrl + ? _NetImage( + url: image, + key: ValueKey( + image + items[index].fuzzyNet, ), + ) + : const SizedBox(width: 24, height: 24), ), const SizedBox(width: 10), Expanded( @@ -399,9 +392,8 @@ class _ExchangeCurrencySelectionViewState left: 12, ), child: CoinTickerTag( - ticker: - items[index].fuzzyNet - .toUpperCase(), + ticker: items[index].fuzzyNet + .toUpperCase(), ), ), ], @@ -409,14 +401,12 @@ class _ExchangeCurrencySelectionViewState const SizedBox(height: 2), Text( items[index].ticker.toUpperCase(), - style: STextStyles.smallMed12( - context, - ).copyWith( - color: - Theme.of(context) + style: STextStyles.smallMed12(context) + .copyWith( + color: Theme.of(context) .extension()! .textSubtitle1, - ), + ), ), ], ), diff --git a/lib/pages/exchange_view/exchange_loading_overlay.dart b/lib/pages/exchange_view/exchange_loading_overlay.dart index 5ccf12cf49..f5ede62ec8 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: [ @@ -99,8 +100,7 @@ class _ExchangeLoadingOverlayViewState 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_view.dart b/lib/pages/exchange_view/exchange_view.dart index 276f7e73fa..1e34f91bcd 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 + .withOpacity(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 9fe4121ee0..d49dfdb4ea 100644 --- a/lib/pages/exchange_view/send_from_view.dart +++ b/lib/pages/exchange_view/send_from_view.dart @@ -106,9 +106,9 @@ class _SendFromViewState 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: () { @@ -381,9 +381,9 @@ class _SendFromCardState extends ConsumerState { child: Text( "Ok", style: STextStyles.button(context).copyWith( - color: Theme.of( - context, - ).extension()!.buttonTextSecondary, + color: Theme.of(context) + .extension()! + .buttonTextSecondary, ), ), onPressed: () { @@ -427,9 +427,9 @@ class _SendFromCardState extends ConsumerState { children: [ if (!trade.exchangeName.startsWith(TrocadorExchange.exchangeName)) MaterialButton( - splashColor: Theme.of( - context, - ).extension()!.highlight, + splashColor: Theme.of(context) + .extension()! + .highlight, key: Key("walletsSheetItemButtonFiroPrivateKey_$walletId"), padding: const EdgeInsets.all(0), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, @@ -481,9 +481,9 @@ class _SendFromCardState extends ConsumerState { Assets.svg.chevronRight, height: 14, width: 7, - color: Theme.of( - context, - ).extension()!.infoItemLabel, + color: Theme.of(context) + .extension()! + .infoItemLabel, ), ], ), @@ -491,9 +491,9 @@ class _SendFromCardState extends ConsumerState { ), ), MaterialButton( - splashColor: Theme.of( - context, - ).extension()!.highlight, + splashColor: Theme.of(context) + .extension()! + .highlight, key: Key("walletsSheetItemButtonFiroPublicKey_$walletId"), padding: const EdgeInsets.all(0), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, @@ -543,9 +543,9 @@ class _SendFromCardState extends ConsumerState { Assets.svg.chevronRight, height: 14, width: 7, - color: Theme.of( - context, - ).extension()!.infoItemLabel, + color: Theme.of(context) + .extension()! + .infoItemLabel, ), ], ), diff --git a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart index a2ffe26db3..559fd63edd 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 + .withOpacity(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..5161b457b1 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 + .withOpacity(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..12e559d8a4 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 + .withOpacity(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 + .withOpacity(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..228a81e2df 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( @@ -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..e46a62017a 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(); } @@ -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 + .withOpacity(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..a576d05c11 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 @@ -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..9e8d66a1de 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( @@ -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..55c177e39b 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, ), @@ -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, ), ], @@ -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, ), ], @@ -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, ), ), ), @@ -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 + .withOpacity(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..f43e22f210 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: () { diff --git a/lib/pages/shopinbit/shopinbit_step_2.dart b/lib/pages/shopinbit/shopinbit_step_2.dart index 742f198e78..8691a23855 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)), @@ -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 2a558ef5dc..59dbda9c07 100644 --- a/lib/pages/shopinbit/shopinbit_ticket_detail.dart +++ b/lib/pages/shopinbit/shopinbit_ticket_detail.dart @@ -432,9 +432,8 @@ class _ShopInBitTicketDetailState extends ConsumerState ); } if (context.mounted) { - await Navigator.of( - context, - ).pushNamed(ShopInBitOfferView.routeName, arguments: _id); + await Navigator.of(context) + .pushNamed(ShopInBitOfferView.routeName, arguments: _id); } } @@ -443,9 +442,9 @@ class _ShopInBitTicketDetailState extends ConsumerState padding: .only(bottom: isDesktop ? 12 : 8), child: RoundedWhiteContainer( borderColor: isDesktop - ? Theme.of( - context, - ).extension()!.textFieldDefaultBG + ? Theme.of(context) + .extension()! + .textFieldDefaultBG : null, child: ConditionalParent( condition: Util.isDesktop, @@ -559,9 +558,9 @@ class _ShopInBitTicketDetailState extends ConsumerState ? STextStyles.desktopTextExtraSmall(context) : STextStyles.field(context)) .copyWith( - color: Theme.of( - context, - ).extension()!.textDark, + color: Theme.of(context) + .extension()! + .textDark, ), decoration: InputDecoration( hintText: "Type a message...", @@ -585,9 +584,9 @@ class _ShopInBitTicketDetailState extends ConsumerState Assets.svg.send, width: 24, height: 24, - color: Theme.of( - context, - ).extension()!.accentColorBlue, + color: Theme.of(context) + .extension()! + .accentColorBlue, ), ), ], @@ -600,9 +599,9 @@ class _ShopInBitTicketDetailState extends ConsumerState padding: EdgeInsets.only(bottom: isDesktop ? 12 : 8), child: RoundedWhiteContainer( borderColor: isDesktop - ? Theme.of( - context, - ).extension()!.textFieldDefaultBG + ? Theme.of(context) + .extension()! + .textFieldDefaultBG : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -698,9 +697,9 @@ class _ShopInBitTicketDetailState 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(), diff --git a/lib/pages/shopinbit/shopinbit_tickets_view.dart b/lib/pages/shopinbit/shopinbit_tickets_view.dart index ed62427921..3b7d368075 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: [ diff --git a/lib/pages/token_view/sub_widgets/token_summary.dart b/lib/pages/token_view/sub_widgets/token_summary.dart index 0f1bd177d4..4119b38501 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 + .withOpacity(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..76d1cc7771 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 + .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, + ), ), ), ), @@ -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..eccb143847 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, ), @@ -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 a4e767048b..76fe70e251 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 @@ -286,9 +286,9 @@ class _DesktopAddressBook extends ConsumerState { buttonHeight: ButtonHeight.l, icon: SvgPicture.asset( Assets.svg.filter, - color: Theme.of( - context, - ).extension()!.buttonTextSecondary, + color: Theme.of(context) + .extension()! + .buttonTextSecondary, ), onPressed: selectCryptocurrency, ), @@ -299,9 +299,9 @@ class _DesktopAddressBook extends ConsumerState { buttonHeight: ButtonHeight.l, icon: SvgPicture.asset( Assets.svg.circlePlus, - color: Theme.of( - context, - ).extension()!.buttonTextPrimary, + color: Theme.of(context) + .extension()! + .buttonTextPrimary, ), onPressed: newContact, ), @@ -343,9 +343,9 @@ class _DesktopAddressBook extends ConsumerState { children: [ if (i > 0) Container( - color: Theme.of( - context, - ).extension()!.background, + color: Theme.of(context) + .extension()! + .background, height: 1, ), Padding( @@ -414,9 +414,9 @@ class _DesktopAddressBook extends ConsumerState { children: [ if (i > 0) Container( - color: Theme.of( - context, - ).extension()!.background, + color: Theme.of(context) + .extension()! + .background, height: 1, ), Padding( 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..59b073371c 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 + .withOpacity(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..5c908f745e 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'; @@ -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/subwidgets/desktop_exchange_steps_indicator.dart b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_exchange_steps_indicator.dart index c8d4ba9ff8..4c1d14a494 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'; @@ -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 + .withOpacity(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 + .withOpacity(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 + .withOpacity(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..fdf14547b4 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 + .withOpacity(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 + .withOpacity(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 + .withOpacity(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 + .withOpacity(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 + .withOpacity(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 + .withOpacity(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 + .withOpacity(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 + .withOpacity(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 + .withOpacity(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 + .withOpacity(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..b23a465e9f 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 + .withOpacity(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 + .withOpacity(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..dff6b5df8a 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)), ); } @@ -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..2beb1de907 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 + .withOpacity(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..9d01e770a8 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) { diff --git a/lib/widgets/custom_buttons/blue_text_button.dart b/lib/widgets/custom_buttons/blue_text_button.dart index 8304498bee..3072fc70f9 100644 --- a/lib/widgets/custom_buttons/blue_text_button.dart +++ b/lib/widgets/custom_buttons/blue_text_button.dart @@ -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..563883c222 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 + .withOpacity(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 + .withOpacity(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..54608bc721 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), ), ); } @@ -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..4e7173d68a 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; @@ -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; @@ -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..cdfb9c9396 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 + .withOpacity(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..12535d7ef6 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,9 +142,9 @@ 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 @@ -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..ecbd99e0a6 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, @@ -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..5e1b7819be 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.withOpacity(0.3) + : _availableColor.withOpacity(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..f1e66683c3 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,10 +77,7 @@ 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: [ @@ -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..24e3d550ee 100644 --- a/lib/widgets/node_card.dart +++ b/lib/widgets/node_card.dart @@ -251,9 +251,9 @@ 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 @@ -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..e6d76d110a 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,9 +150,9 @@ class NodeOptionsSheet extends ConsumerWidget { node.id.startsWith( DefaultNodes.defaultNodeIdPrefix, ) - ? Theme.of( - context, - ).extension()!.textSubtitle4 + ? Theme.of(context) + .extension()! + .textSubtitle4 : Theme.of(context) .extension()! .infoItemIcons @@ -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..07172737b8 100644 --- a/lib/widgets/toggle.dart +++ b/lib/widgets/toggle.dart @@ -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 e5450c39ad..6386d720a3 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 @@ -48,18 +48,14 @@ class _WalletInfoCoinIconState extends ConsumerState { ExchangeDataLoadingService.instance.isar.then((isar) async { if (widget.contractAddress != null) { - final currency = - await isar.currencies - .where() - .exchangeNameEqualTo(ChangeNowExchange.exchangeName) - .filter() - .tokenContractEqualTo( - widget.contractAddress!, - caseSensitive: false, - ) - .and() - .imageIsNotEmpty() - .findFirst(); + final currency = await isar.currencies + .where() + .exchangeNameEqualTo(ChangeNowExchange.exchangeName) + .filter() + .tokenContractEqualTo(widget.contractAddress!, caseSensitive: false) + .and() + .imageIsNotEmpty() + .findFirst(); if (mounted) { WidgetsBinding.instance.addPostFrameCallback((_) { @@ -87,14 +83,13 @@ class _WalletInfoCoinIconState extends ConsumerState { ), child: Padding( padding: EdgeInsets.all(widget.size / 5), - child: - imageUrl != null && imageUrl!.isNotEmpty - ? SvgPicture.network(imageUrl!, width: 20, height: 20) - : SvgPicture.file( - File(ref.watch(coinIconProvider(widget.coin))), - width: 20, - height: 20, - ), + child: imageUrl != null && imageUrl!.isNotEmpty + ? SvgPicture.network(imageUrl!, width: 20, height: 20) + : SvgPicture.file( + File(ref.watch(coinIconProvider(widget.coin))), + width: 20, + height: 20, + ), ), ); } 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..9789f095ec 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 + .withOpacity(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..2c6fd90f5e 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'; @@ -25,9 +26,7 @@ class FrostSignNavIcon extends ConsumerWidget { .extension()! .bottomNavIconIcon .withOpacity(0.4), - borderRadius: BorderRadius.circular( - 24, - ), + 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..c29748d5af 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'; @@ -24,9 +25,7 @@ class ReceiveNavIcon extends StatelessWidget { .extension()! .bottomNavIconIcon .withOpacity(0.4), - borderRadius: BorderRadius.circular( - 24, - ), + 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..a82c471db7 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'; @@ -24,9 +25,7 @@ class SendNavIcon extends StatelessWidget { .extension()! .bottomNavIconIcon .withOpacity(0.4), - borderRadius: BorderRadius.circular( - 24, - ), + 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..be5cadd976 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.withOpacity(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 From 32f137cf8957e2a2048cc4413e04a6cb7edf8a46 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 6 Oct 2026 21:27:02 -0500 Subject: [PATCH 4/4] refactor: migrate deprecated withOpacity to withValues `Color.withOpacity` is deprecated in the pinned Flutter SDK. `withValues` stores alpha as a double instead of quantising it to 8 bits; `toARGB32()` rounds to the same byte for every alpha, so nothing renders differently. 83 call sites in 52 files. Reproducible from the preceding commit: substitute `.withOpacity(X)` -> `.withValues(alpha: X)` and run `dart format`. --- .../notification_card_layout.dart | 4 +++- lib/pages/buy_view/buy_form.dart | 4 ++-- lib/pages/buy_view/buy_view.dart | 2 +- .../exchange_currency_selection_view.dart | 2 +- lib/pages/exchange_view/exchange_form.dart | 2 +- .../exchange_loading_overlay.dart | 4 ++-- .../exchange_step_views/step_3_view.dart | 2 +- lib/pages/exchange_view/exchange_view.dart | 2 +- lib/pages/exchange_view/send_from_view.dart | 2 +- .../wallet_initiated_exchange_view.dart | 2 +- .../paynym/subwidgets/paynym_card_button.dart | 2 +- lib/pages/receive_view/receive_view.dart | 4 ++-- .../sub_widgets/mwc_slatepack_dialog.dart | 2 +- .../stack_backup_views/auto_backup_view.dart | 6 +++--- .../startup_wallet_selection_view.dart | 2 +- .../wallet_syncing_options_view.dart | 2 +- .../wallet_network_settings_view.dart | 10 +++++----- .../shopinbit/shopinbit_send_from_view.dart | 2 +- lib/pages/shopinbit/shopinbit_step_2.dart | 2 +- .../shopinbit/shopinbit_ticket_detail.dart | 6 +++--- .../shopinbit/shopinbit_tickets_view.dart | 2 +- .../token_view/sub_widgets/token_summary.dart | 2 +- .../sub_widgets/token_summary_sol.dart | 2 +- .../sub_widgets/wallet_summary_info.dart | 2 +- .../desktop_address_book.dart | 11 ++++++---- .../desktop_buy/desktop_buy_view.dart | 2 +- .../desktop_exchange_view.dart | 2 +- .../exchange_steps/step_scaffold.dart | 2 +- .../desktop_exchange_steps_indicator.dart | 8 ++++---- .../desktop_menu_item.dart | 20 +++++++++---------- .../sub_widgets/desktop_receive.dart | 4 ++-- .../sub_widgets/network_info_button.dart | 2 +- lib/utilities/show_loading.dart | 2 +- lib/utilities/text_styles.dart | 4 ++-- .../custom_buttons/blue_text_button.dart | 4 ++-- .../draggable_switch_button.dart | 4 ++-- .../custom_buttons/dropdown_button.dart | 2 +- lib/widgets/custom_pin_put/pin_keyboard.dart | 4 ++-- lib/widgets/date_picker/date_picker.dart | 2 +- lib/widgets/epicbox_card.dart | 2 +- lib/widgets/frost_scaffold.dart | 2 +- .../icon_widgets/utxo_status_icon.dart | 4 ++-- lib/widgets/managed_favorite.dart | 2 +- lib/widgets/node_card.dart | 2 +- lib/widgets/node_options_sheet.dart | 2 +- lib/widgets/toggle.dart | 4 ++-- .../wallet_info_row_coin_icon.dart | 2 +- .../components/icons/finalize_nav_icon.dart | 2 +- .../components/icons/frost_sign_nav_icon.dart | 2 +- .../components/icons/receive_nav_icon.dart | 2 +- .../components/icons/send_nav_icon.dart | 2 +- .../wallet_navigation_bar.dart | 2 +- 52 files changed, 90 insertions(+), 85 deletions(-) diff --git a/lib/notifications/notification_card_layout.dart b/lib/notifications/notification_card_layout.dart index ed5380bd75..191e0da666 100644 --- a/lib/notifications/notification_card_layout.dart +++ b/lib/notifications/notification_card_layout.dart @@ -83,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 078b797dec..178c041674 100644 --- a/lib/pages/buy_view/buy_view.dart +++ b/lib/pages/buy_view/buy_view.dart @@ -74,7 +74,7 @@ class _BuyViewState extends ConsumerState { color: Theme.of(context) .extension()! .overlay - .withOpacity(0.7), + .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 9c400e1b53..0627077734 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 @@ -79,7 +79,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 c5488964a4..9709d02280 100644 --- a/lib/pages/exchange_view/exchange_form.dart +++ b/lib/pages/exchange_view/exchange_form.dart @@ -123,7 +123,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 f5ede62ec8..6e1444634a 100644 --- a/lib/pages/exchange_view/exchange_loading_overlay.dart +++ b/lib/pages/exchange_view/exchange_loading_overlay.dart @@ -80,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, @@ -94,7 +94,7 @@ class _ExchangeLoadingOverlayViewState color: Theme.of(context) .extension()! .overlay - .withOpacity(0.7), + .withValues(alpha: 0.7), child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ 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 1e34f91bcd..2f41fa32c8 100644 --- a/lib/pages/exchange_view/exchange_view.dart +++ b/lib/pages/exchange_view/exchange_view.dart @@ -97,7 +97,7 @@ class _ExchangeViewState 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", diff --git a/lib/pages/exchange_view/send_from_view.dart b/lib/pages/exchange_view/send_from_view.dart index d49dfdb4ea..7f9594da58 100644 --- a/lib/pages/exchange_view/send_from_view.dart +++ b/lib/pages/exchange_view/send_from_view.dart @@ -579,7 +579,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 559fd63edd..62b18c8715 100644 --- a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart +++ b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart @@ -114,7 +114,7 @@ class _WalletInitiatedExchangeViewState 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", diff --git a/lib/pages/paynym/subwidgets/paynym_card_button.dart b/lib/pages/paynym/subwidgets/paynym_card_button.dart index 5161b457b1..d5bb3e3709 100644 --- a/lib/pages/paynym/subwidgets/paynym_card_button.dart +++ b/lib/pages/paynym/subwidgets/paynym_card_button.dart @@ -55,7 +55,7 @@ class _PaynymCardButtonState extends ConsumerState { ? Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.08) + .withValues(alpha: 0.08) : Colors.transparent, child: RawMaterialButton( padding: const EdgeInsets.all(0), diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index 12e559d8a4..0ac4d86eb0 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -228,7 +228,7 @@ class _ReceiveViewState extends ConsumerState { color: Theme.of(context) .extension()! .overlay - .withOpacity(0.5), + .withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, @@ -310,7 +310,7 @@ class _ReceiveViewState extends ConsumerState { color: Theme.of(context) .extension()! .overlay - .withOpacity(0.5), + .withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, 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 228a81e2df..5eb6cedb0d 100644 --- a/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart +++ b/lib/pages/send_view/sub_widgets/mwc_slatepack_dialog.dart @@ -116,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( 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 e46a62017a..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 @@ -367,7 +367,7 @@ class _AutoBackupViewState extends ConsumerState { color: Theme.of(context) .extension()! .textDark - .withOpacity(0.5), + .withValues(alpha: 0.5), ), readOnly: true, enableSuggestions: false, @@ -399,7 +399,7 @@ class _AutoBackupViewState extends ConsumerState { color: Theme.of(context) .extension()! .textDark - .withOpacity(0.5), + .withValues(alpha: 0.5), ), obscureText: true, enableSuggestions: false, @@ -433,7 +433,7 @@ class _AutoBackupViewState extends ConsumerState { color: Theme.of(context) .extension()! .textDark - .withOpacity(0.5), + .withValues(alpha: 0.5), ), toolbarOptions: const ToolbarOptions( copy: true, 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 a576d05c11..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 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 9e8d66a1de..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 @@ -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, ), 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 55c177e39b..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 @@ -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( @@ -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( @@ -700,7 +700,7 @@ class _WalletNetworkSettingsViewState color: Theme.of(context) .extension()! .accentColorRed - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(_iconSize), ), child: Center( @@ -848,7 +848,7 @@ class _WalletNetworkSettingsViewState color: Theme.of(context) .extension()! .accentColorGreen - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(_iconSize), ), child: Center( @@ -872,7 +872,7 @@ class _WalletNetworkSettingsViewState color: Theme.of(context) .extension()! .textDark - .withOpacity(0.08), + .withValues(alpha: 0.08), borderRadius: BorderRadius.circular(_iconSize), ), child: Center( diff --git a/lib/pages/shopinbit/shopinbit_send_from_view.dart b/lib/pages/shopinbit/shopinbit_send_from_view.dart index f43e22f210..7c3b289567 100644 --- a/lib/pages/shopinbit/shopinbit_send_from_view.dart +++ b/lib/pages/shopinbit/shopinbit_send_from_view.dart @@ -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 8691a23855..7e8469da6a 100644 --- a/lib/pages/shopinbit/shopinbit_step_2.dart +++ b/lib/pages/shopinbit/shopinbit_step_2.dart @@ -236,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( diff --git a/lib/pages/shopinbit/shopinbit_ticket_detail.dart b/lib/pages/shopinbit/shopinbit_ticket_detail.dart index 59dbda9c07..9ae235d136 100644 --- a/lib/pages/shopinbit/shopinbit_ticket_detail.dart +++ b/lib/pages/shopinbit/shopinbit_ticket_detail.dart @@ -394,7 +394,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, @@ -980,8 +980,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 3b7d368075..d0f0ddb01e 100644 --- a/lib/pages/shopinbit/shopinbit_tickets_view.dart +++ b/lib/pages/shopinbit/shopinbit_tickets_view.dart @@ -433,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 4119b38501..cb52e97659 100644 --- a/lib/pages/token_view/sub_widgets/token_summary.dart +++ b/lib/pages/token_view/sub_widgets/token_summary.dart @@ -286,7 +286,7 @@ class TokenOptionsButton extends StatelessWidget { color: Theme.of(context) .extension()! .tokenSummaryIcon - .withOpacity(0.4), + .withValues(alpha: 0.4), radiusMultiplier: 10, child: Center(child: child), ), 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 76d1cc7771..b6a5d8b178 100644 --- a/lib/pages/token_view/sub_widgets/token_summary_sol.dart +++ b/lib/pages/token_view/sub_widgets/token_summary_sol.dart @@ -270,7 +270,7 @@ class TokenOptionsButton extends StatelessWidget { color: Theme.of(context) .extension()! .tokenSummaryIcon - .withOpacity(0.4), + .withValues(alpha: 0.4), radiusMultiplier: 10, child: Center(child: child), ), 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 eccb143847..33d478116c 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart @@ -196,7 +196,7 @@ class WalletSummaryInfo extends ConsumerWidget { color: Theme.of(context) .extension()! .textFavoriteCard - .withOpacity(0.7), + .withValues(alpha: 0.7), ), ), ), 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 76fe70e251..87b10c6238 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 @@ -355,8 +355,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, ), @@ -426,8 +428,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 59b073371c..206f6af81a 100644 --- a/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart +++ b/lib/pages_desktop_specific/desktop_buy/desktop_buy_view.dart @@ -101,7 +101,7 @@ class _DesktopBuyViewState extends ConsumerState { color: Theme.of(context) .extension()! .overlay - .withOpacity(0.7), + .withValues(alpha: 0.7), height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, child: DesktopDialog( 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 5c908f745e..5f7e70c86f 100644 --- a/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart +++ b/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart @@ -90,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", 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 4c1d14a494..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 @@ -24,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; } @@ -65,7 +65,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { color: Theme.of(context) .extension()! .accentColorBlue - .withOpacity(0.5), + .withValues(alpha: 0.5), ), ), crossFadeState: currentStep == 1 @@ -114,7 +114,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { color: Theme.of(context) .extension()! .accentColorBlue - .withOpacity(0.5), + .withValues(alpha: 0.5), ), ), crossFadeState: currentStep == 2 && currentStep > 1 @@ -168,7 +168,7 @@ class DesktopExchangeStepsIndicator extends StatelessWidget { color: Theme.of(context) .extension()! .accentColorBlue - .withOpacity(0.5), + .withValues(alpha: 0.5), ), ), crossFadeState: currentStep == 3 && currentStep > 2 diff --git a/lib/pages_desktop_specific/desktop_menu_item.dart b/lib/pages_desktop_specific/desktop_menu_item.dart index fdf14547b4..e14134f3c1 100644 --- a/lib/pages_desktop_specific/desktop_menu_item.dart +++ b/lib/pages_desktop_specific/desktop_menu_item.dart @@ -48,7 +48,7 @@ class DesktopMyStackIcon extends ConsumerWidget { : Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.8), + .withValues(alpha: 0.8), ); } } @@ -69,7 +69,7 @@ class DesktopExchangeIcon extends ConsumerWidget { : Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.8), + .withValues(alpha: 0.8), ); } } @@ -90,7 +90,7 @@ class DesktopBuyIcon extends ConsumerWidget { : Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.8), + .withValues(alpha: 0.8), ); } } @@ -111,7 +111,7 @@ class DesktopServicesIcon extends ConsumerWidget { : Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.8), + .withValues(alpha: 0.8), ); } } @@ -141,7 +141,7 @@ class DesktopNotificationsIcon extends ConsumerWidget { : Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.8), + .withValues(alpha: 0.8), ); } } @@ -162,7 +162,7 @@ class DesktopAddressBookIcon extends ConsumerWidget { : Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.8), + .withValues(alpha: 0.8), ); } } @@ -183,7 +183,7 @@ class DesktopSettingsIcon extends ConsumerWidget { : Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.8), + .withValues(alpha: 0.8), ); } } @@ -204,7 +204,7 @@ class DesktopSupportIcon extends ConsumerWidget { : Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.8), + .withValues(alpha: 0.8), ); } } @@ -225,7 +225,7 @@ class DesktopAboutIcon extends ConsumerWidget { : Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.8), + .withValues(alpha: 0.8), ); } } @@ -242,7 +242,7 @@ class DesktopExitIcon extends ConsumerWidget { color: Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.8), + .withValues(alpha: 0.8), ); } } 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 b23a465e9f..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 @@ -246,7 +246,7 @@ class _DesktopReceiveState extends ConsumerState { color: Theme.of(context) .extension()! .overlay - .withOpacity(0.5), + .withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, @@ -326,7 +326,7 @@ class _DesktopReceiveState extends ConsumerState { color: Theme.of(context) .extension()! .overlay - .withOpacity(0.5), + .withValues(alpha: 0.5), child: const CustomLoadingOverlay( message: "Generating address", eventBus: null, 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 dff6b5df8a..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 @@ -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) { diff --git a/lib/utilities/show_loading.dart b/lib/utilities/show_loading.dart index 2beb1de907..215f48628f 100644 --- a/lib/utilities/show_loading.dart +++ b/lib/utilities/show_loading.dart @@ -49,7 +49,7 @@ Future showLoading({ color: Theme.of(context) .extension()! .overlay - .withOpacity(opaqueBG ? 1.0 : 0.6), + .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 9d01e770a8..e3763c5486 100644 --- a/lib/utilities/text_styles.dart +++ b/lib/utilities/text_styles.dart @@ -719,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, @@ -743,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 3072fc70f9..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, ), ), diff --git a/lib/widgets/custom_buttons/draggable_switch_button.dart b/lib/widgets/custom_buttons/draggable_switch_button.dart index 563883c222..1eb0fae3d0 100644 --- a/lib/widgets/custom_buttons/draggable_switch_button.dart +++ b/lib/widgets/custom_buttons/draggable_switch_button.dart @@ -51,7 +51,7 @@ class DraggableSwitchButtonState extends State { Theme.of(context) .extension()! .switchBGOn - .withOpacity(alpha), + .withValues(alpha: alpha), Theme.of(context).extension()!.switchBGOff, ); } @@ -64,7 +64,7 @@ class DraggableSwitchButtonState extends State { Theme.of(context) .extension()! .switchCircleOn - .withOpacity(alpha), + .withValues(alpha: alpha), Theme.of(context).extension()!.switchCircleOff, ); } diff --git a/lib/widgets/custom_buttons/dropdown_button.dart b/lib/widgets/custom_buttons/dropdown_button.dart index 54608bc721..b7ce28d627 100644 --- a/lib/widgets/custom_buttons/dropdown_button.dart +++ b/lib/widgets/custom_buttons/dropdown_button.dart @@ -295,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( diff --git a/lib/widgets/custom_pin_put/pin_keyboard.dart b/lib/widgets/custom_pin_put/pin_keyboard.dart index 4e7173d68a..ef8cb21c77 100644 --- a/lib/widgets/custom_pin_put/pin_keyboard.dart +++ b/lib/widgets/custom_pin_put/pin_keyboard.dart @@ -65,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), () { @@ -129,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), () { diff --git a/lib/widgets/date_picker/date_picker.dart b/lib/widgets/date_picker/date_picker.dart index cdfb9c9396..b6e7a000f6 100644 --- a/lib/widgets/date_picker/date_picker.dart +++ b/lib/widgets/date_picker/date_picker.dart @@ -56,7 +56,7 @@ Future?> showSWDatePicker( daySplashColor: Theme.of(context) .extension()! .accentColorDark - .withOpacity(0.6), + .withValues(alpha: 0.6), ), ); diff --git a/lib/widgets/epicbox_card.dart b/lib/widgets/epicbox_card.dart index 12535d7ef6..25792eef1d 100644 --- a/lib/widgets/epicbox_card.dart +++ b/lib/widgets/epicbox_card.dart @@ -148,7 +148,7 @@ class _EpicBoxCardState extends ConsumerState { : Theme.of(context) .extension()! .infoItemIcons - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(100), ), child: Center( diff --git a/lib/widgets/frost_scaffold.dart b/lib/widgets/frost_scaffold.dart index ecbd99e0a6..599c654dc3 100644 --- a/lib/widgets/frost_scaffold.dart +++ b/lib/widgets/frost_scaffold.dart @@ -158,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, ), diff --git a/lib/widgets/icon_widgets/utxo_status_icon.dart b/lib/widgets/icon_widgets/utxo_status_icon.dart index 5e1b7819be..4a28f1eb07 100644 --- a/lib/widgets/icon_widgets/utxo_status_icon.dart +++ b/lib/widgets/icon_widgets/utxo_status_icon.dart @@ -80,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, ), diff --git a/lib/widgets/managed_favorite.dart b/lib/widgets/managed_favorite.dart index f1e66683c3..dd8ae260a3 100644 --- a/lib/widgets/managed_favorite.dart +++ b/lib/widgets/managed_favorite.dart @@ -83,7 +83,7 @@ class _ManagedFavoriteCardState 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/widgets/node_card.dart b/lib/widgets/node_card.dart index 24e3d550ee..ba7dac1d8b 100644 --- a/lib/widgets/node_card.dart +++ b/lib/widgets/node_card.dart @@ -257,7 +257,7 @@ class _NodeCardState extends ConsumerState { : Theme.of(context) .extension()! .infoItemIcons - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(100), ), child: Center( diff --git a/lib/widgets/node_options_sheet.dart b/lib/widgets/node_options_sheet.dart index e6d76d110a..ec60bd9341 100644 --- a/lib/widgets/node_options_sheet.dart +++ b/lib/widgets/node_options_sheet.dart @@ -156,7 +156,7 @@ class NodeOptionsSheet extends ConsumerWidget { : Theme.of(context) .extension()! .infoItemIcons - .withOpacity(0.2), + .withValues(alpha: 0.2), borderRadius: BorderRadius.circular(100), ), child: Center( diff --git a/lib/widgets/toggle.dart b/lib/widgets/toggle.dart index 07172737b8..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, // ); // } 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 6386d720a3..5cc75b3dd2 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 @@ -76,7 +76,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 9789f095ec..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 @@ -24,7 +24,7 @@ class FinalizeNavIcon extends StatelessWidget { color: Theme.of(context) .extension()! .bottomNavIconIcon - .withOpacity(0.4), + .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 2c6fd90f5e..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 @@ -25,7 +25,7 @@ class FrostSignNavIcon extends ConsumerWidget { color: Theme.of(context) .extension()! .bottomNavIconIcon - .withOpacity(0.4), + .withValues(alpha: 0.4), borderRadius: BorderRadius.circular(24), ), child: Padding( 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 c29748d5af..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 @@ -24,7 +24,7 @@ class ReceiveNavIcon extends StatelessWidget { color: Theme.of(context) .extension()! .bottomNavIconIcon - .withOpacity(0.4), + .withValues(alpha: 0.4), borderRadius: BorderRadius.circular(24), ), child: Padding( 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 a82c471db7..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 @@ -24,7 +24,7 @@ class SendNavIcon extends StatelessWidget { color: Theme.of(context) .extension()! .bottomNavIconIcon - .withOpacity(0.4), + .withValues(alpha: 0.4), borderRadius: BorderRadius.circular(24), ), child: Padding( diff --git a/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart b/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart index be5cadd976..530f31f59b 100644 --- a/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart +++ b/lib/widgets/wallet_navigation_bar/wallet_navigation_bar.dart @@ -67,7 +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)), ), ), ),