diff --git a/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart b/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart index 7faae106f..603b72338 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart @@ -10,6 +10,7 @@ import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; +import 'package:stackwallet/utilities/util.dart'; /// [eventBus] should only be set during testing class WalletRefreshButton extends ConsumerStatefulWidget { @@ -70,7 +71,7 @@ class _RefreshButtonState extends ConsumerState _spinController?.stop(); break; case WalletSyncStatus.syncing: - _spinController?.repeat(); + unawaited(_spinController?.repeat()); break; } } @@ -92,10 +93,15 @@ class _RefreshButtonState extends ConsumerState @override Widget build(BuildContext context) { + final isDesktop = Util.isDesktop; + return SizedBox( - height: 36, - width: 36, + height: isDesktop ? 22 : 36, + width: isDesktop ? 22 : 36, child: MaterialButton( + color: isDesktop + ? Theme.of(context).extension()!.buttonBackSecondary + : null, splashColor: Theme.of(context).extension()!.highlight, onPressed: () { final managerProvider = ref @@ -110,6 +116,9 @@ class _RefreshButtonState extends ConsumerState .then((_) => _spinController?.stop()); } }, + elevation: 0, + highlightElevation: 0, + hoverElevation: 0, padding: EdgeInsets.zero, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( @@ -121,9 +130,13 @@ class _RefreshButtonState extends ConsumerState turns: _spinAnimation, child: SvgPicture.asset( Assets.svg.arrowRotate, - width: 24, - height: 24, - color: Theme.of(context).extension()!.textFavoriteCard, + width: isDesktop ? 12 : 24, + height: isDesktop ? 12 : 24, + color: isDesktop + ? Theme.of(context) + .extension()! + .textFieldDefaultSearchIconRight + : Theme.of(context).extension()!.textFavoriteCard, ), ), ), diff --git a/lib/pages_desktop_specific/home/my_stack_view/wallet_view/desktop_wallet_summary.dart b/lib/pages_desktop_specific/home/my_stack_view/wallet_view/desktop_wallet_summary.dart index fe2cfa7b2..7a9e93467 100644 --- a/lib/pages_desktop_specific/home/my_stack_view/wallet_view/desktop_wallet_summary.dart +++ b/lib/pages_desktop_specific/home/my_stack_view/wallet_view/desktop_wallet_summary.dart @@ -1,17 +1,13 @@ import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/wallet_balance_toggle_sheet.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/wallet_refresh_button.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/providers/wallet/wallet_balance_toggle_state_provider.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; -import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; -import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; @@ -100,9 +96,9 @@ class _WDesktopWalletSummaryState extends State { final priceTuple = ref.watch(priceAnd24hChangeNotifierProvider .select((value) => value.getPrice(coin))); - final _showAvailable = - ref.watch(walletBalanceToggleStateProvider.state).state == - WalletBalanceToggleState.available; + final _showAvailable = false; + // ref.watch(walletBalanceToggleStateProvider.state).state == + // WalletBalanceToggleState.available; return FutureBuilder( future: _showAvailable @@ -125,46 +121,46 @@ class _WDesktopWalletSummaryState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - GestureDetector( - onTap: showSheet, - child: Row( - children: [ - if (coin == Coin.firo || - coin == Coin.firoTestNet) - Text( - "${_showAvailable ? "Private" : "Public"} Balance", - style: STextStyles.subtitle500(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textFavoriteCard, - ), - ), - if (coin != Coin.firo && - coin != Coin.firoTestNet) - Text( - "${_showAvailable ? "Available" : "Full"} Balance", - style: STextStyles.subtitle500(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textFavoriteCard, - ), - ), - const SizedBox( - width: 4, - ), - SvgPicture.asset( - Assets.svg.chevronDown, - color: Theme.of(context) - .extension()! - .textFavoriteCard, - width: 8, - height: 4, - ), - ], - ), - ), + // GestureDetector( + // onTap: showSheet, + // child: Row( + // children: [ + // if (coin == Coin.firo || + // coin == Coin.firoTestNet) + // Text( + // "${_showAvailable ? "Private" : "Public"} Balance", + // style: STextStyles.subtitle500(context) + // .copyWith( + // color: Theme.of(context) + // .extension()! + // .textFavoriteCard, + // ), + // ), + // if (coin != Coin.firo && + // coin != Coin.firoTestNet) + // Text( + // "${_showAvailable ? "Available" : "Full"} Balance", + // style: STextStyles.subtitle500(context) + // .copyWith( + // color: Theme.of(context) + // .extension()! + // .textFavoriteCard, + // ), + // ), + // const SizedBox( + // width: 4, + // ), + // SvgPicture.asset( + // Assets.svg.chevronDown, + // color: Theme.of(context) + // .extension()! + // .textFavoriteCard, + // width: 8, + // height: 4, + // ), + // ], + // ), + // ), FittedBox( fit: BoxFit.scaleDown, child: Text( @@ -196,46 +192,46 @@ class _WDesktopWalletSummaryState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - GestureDetector( - onTap: showSheet, - child: Row( - children: [ - if (coin == Coin.firo || - coin == Coin.firoTestNet) - Text( - "${_showAvailable ? "Private" : "Public"} Balance", - style: STextStyles.subtitle500(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textFavoriteCard, - ), - ), - if (coin != Coin.firo && - coin != Coin.firoTestNet) - Text( - "${_showAvailable ? "Available" : "Full"} Balance", - style: STextStyles.subtitle500(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textFavoriteCard, - ), - ), - const SizedBox( - width: 4, - ), - SvgPicture.asset( - Assets.svg.chevronDown, - width: 8, - height: 4, - color: Theme.of(context) - .extension()! - .textFavoriteCard, - ), - ], - ), - ), + // GestureDetector( + // onTap: showSheet, + // child: Row( + // children: [ + // if (coin == Coin.firo || + // coin == Coin.firoTestNet) + // Text( + // "${_showAvailable ? "Private" : "Public"} Balance", + // style: STextStyles.subtitle500(context) + // .copyWith( + // color: Theme.of(context) + // .extension()! + // .textFavoriteCard, + // ), + // ), + // if (coin != Coin.firo && + // coin != Coin.firoTestNet) + // Text( + // "${_showAvailable ? "Available" : "Full"} Balance", + // style: STextStyles.subtitle500(context) + // .copyWith( + // color: Theme.of(context) + // .extension()! + // .textFavoriteCard, + // ), + // ), + // const SizedBox( + // width: 4, + // ), + // SvgPicture.asset( + // Assets.svg.chevronDown, + // width: 8, + // height: 4, + // color: Theme.of(context) + // .extension()! + // .textFavoriteCard, + // ), + // ], + // ), + // ), AnimatedText( stringsToLoopThrough: const [ "Loading balance ", @@ -250,20 +246,21 @@ class _WDesktopWalletSummaryState extends State { .textFavoriteCard, ), ), - AnimatedText( - stringsToLoopThrough: const [ - "Loading balance ", - "Loading balance. ", - "Loading balance.. ", - "Loading balance..." - ], - style: STextStyles.desktopTextExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textSubtitle1, + if (externalCalls) + AnimatedText( + stringsToLoopThrough: const [ + "Loading balance ", + "Loading balance. ", + "Loading balance.. ", + "Loading balance..." + ], + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textSubtitle1, + ), ), - ), ], ); } @@ -273,6 +270,9 @@ class _WDesktopWalletSummaryState extends State { ), ], ), + const SizedBox( + width: 8, + ), WalletRefreshButton( walletId: walletId, initialSyncStatus: widget.initialSyncStatus,