add breathing effect to recent activity on desktop

This commit is contained in:
julian 2024-06-27 14:53:39 -06:00
parent 43071c01df
commit c8a868a840
3 changed files with 180 additions and 154 deletions

View file

@ -13,6 +13,7 @@ import '../../../../utilities/text_styles.dart';
import '../../../../utilities/util.dart';
import '../../../../wallets/crypto_currency/crypto_currency.dart';
import '../../../../wallets/isar/providers/wallet_info_provider.dart';
import '../../../../widgets/breathing.dart';
import '../../../../widgets/desktop/desktop_dialog.dart';
import '../../../../widgets/desktop/desktop_dialog_close_button.dart';
import '../../../../widgets/trade_card.dart';
@ -49,6 +50,7 @@ class TxListItem extends ConsumerWidget {
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: radius,
),
child: Breathing(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@ -91,8 +93,8 @@ class TxListItem extends ConsumerWidget {
children: [
Text(
"Trade details",
style:
STextStyles.desktopH3(context),
style: STextStyles.desktopH3(
context),
),
DesktopDialogCloseButton(
onPressedOverride: Navigator.of(
@ -142,6 +144,7 @@ class TxListItem extends ConsumerWidget {
),
],
),
),
);
} else {
return Container(
@ -149,11 +152,13 @@ class TxListItem extends ConsumerWidget {
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: radius,
),
child: Breathing(
child: TransactionCardV2(
// this may mess with combined firo transactions
key: UniqueKey(),
transaction: _tx,
),
),
);
}
}
@ -165,10 +170,12 @@ class TxListItem extends ConsumerWidget {
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: radius,
),
child: Breathing(
child: FusionTxGroupCard(
key: UniqueKey(),
group: group,
),
),
);
}
}

View file

@ -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 '../../pages/wallets_view/wallets_overview.dart';
import '../../providers/providers.dart';
import '../../themes/coin_icon_provider.dart';
@ -21,6 +22,7 @@ import '../../utilities/amount/amount.dart';
import '../../utilities/text_styles.dart';
import '../../wallets/crypto_currency/crypto_currency.dart';
import '../../wallets/isar/providers/all_wallets_info_provider.dart';
import '../../widgets/breathing.dart';
import '../../widgets/conditional_parent.dart';
import '../../widgets/desktop/desktop_dialog.dart';
import '../../widgets/desktop/desktop_dialog_close_button.dart';
@ -146,18 +148,7 @@ class _DesktopWalletSummaryRowState
@override
Widget build(BuildContext context) {
return MouseRegion(
onEnter: (_) => setState(
() => _hovering = true,
),
onExit: (_) => setState(
() => _hovering = false,
),
child: AnimatedScale(
scale: _hovering ? 1.00 : 0.98,
duration: const Duration(
milliseconds: 200,
),
return Breathing(
child: RoundedWhiteContainer(
padding: const EdgeInsets.all(20),
hoverColor: Colors.transparent,
@ -180,11 +171,9 @@ class _DesktopWalletSummaryRowState
),
Text(
widget.coin.prettyName,
style:
STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
style: STextStyles.desktopTextExtraSmall(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.textDark,
),
),
],
@ -197,9 +186,8 @@ class _DesktopWalletSummaryRowState
? "${widget.walletCount} wallet"
: "${widget.walletCount} wallets",
style: STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
color:
Theme.of(context).extension<StackColors>()!.textSubtitle1,
),
),
),
@ -212,7 +200,6 @@ class _DesktopWalletSummaryRowState
],
),
),
),
);
}
}

View file

@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
class Breathing extends StatefulWidget {
const Breathing({super.key, required this.child});
final Widget child;
@override
State<Breathing> createState() => _BreathingState();
}
class _BreathingState extends State<Breathing> {
bool _hovering = false;
@override
Widget build(BuildContext context) {
return MouseRegion(
onEnter: (_) => setState(
() => _hovering = true,
),
onExit: (_) => setState(
() => _hovering = false,
),
child: AnimatedScale(
scale: _hovering ? 1.00 : 0.98,
duration: const Duration(
milliseconds: 200,
),
child: widget.child,
),
);
}
}