Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
fix: Animation size overflow bug
Browse files Browse the repository at this point in the history
  • Loading branch information
reasje committed May 26, 2024
1 parent 5dc7be2 commit 15aea4e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/features/dapps/presentation/responsive_layout/dapp_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ class DAppCard extends HookConsumerWidget {
final isMobile = mainAxisCount == CardMainAxisCount.mobile;

final imageRatioFactor = (isMobile ? 0.2 : 0.1);
final size = (isMobile ? 0.4 : 0.3);
final sizeLimit = imageRatioFactor / size;
final animatedSize = (isMobile ? 0.3 : 0.15);
final sizeLimit = (imageRatioFactor / animatedSize);

Widget getCardItem({void Function()? shatter}) {
final contextMenuActions = dapp is Bookmark?
Expand All @@ -281,17 +281,19 @@ class DAppCard extends HookConsumerWidget {
return CupertinoContextMenuExtended.builder(
builder: (context, animation) {
return SizedBox(
width: MediaQuery.of(context).size.width /
(mainAxisCount - animation.value),
height: MediaQuery.of(context).size.width /
(mainAxisCount - animation.value),
child: cardBox(context,
width: MediaQuery.of(context).size.width / (mainAxisCount),
height: MediaQuery.of(context).size.width / (mainAxisCount),
child: Center(
child: cardBox(
context,
ratioFactor: animation.value < sizeLimit
? null
: (size * animation.value),
: (animatedSize * animation.value),
shatter: shatter,
actions: actions,
animated: animation.value != 0.0),
animated: animation.value != 0.0,
),
),
);
},
actions: contextMenuActions,
Expand Down

0 comments on commit 15aea4e

Please sign in to comment.