animation fix

This commit is contained in:
Dmitry 2024-06-05 06:04:16 +03:00
parent 69afc51781
commit 7ac591172b
4 changed files with 5 additions and 2 deletions

View file

@ -157,6 +157,7 @@ class _CardGamePageState extends State<CardGamePage> {
left: 10.0.w, left: 10.0.w,
right: 10.0.w, right: 10.0.w,
bottom: 10.0.h, bottom: 10.0.h,
top: 10.0.h,
), ),
child: Row( child: Row(
children: [ children: [

View file

@ -223,6 +223,7 @@ class _CardBuilder extends StatelessWidget {
animation: a, animation: a,
builder: (context, child) => GameCardDecoration( builder: (context, child) => GameCardDecoration(
alpha: a.value, alpha: a.value,
borderColor: cardPack.color?.asColor,
child: FrontCard( child: FrontCard(
card, card,
card.memoryImage!, card.memoryImage!,

View file

@ -200,8 +200,8 @@ class FrontCard extends StatelessWidget {
if (constrains.maxHeight.isInfinite) { if (constrains.maxHeight.isInfinite) {
ar = 16 / 9; ar = 16 / 9;
} }
final textScale = min(1.0, ar / targetTextAr) * alpha; final textScale = min(1.0, ar / targetTextAr) * alpha * alpha;
final imageScale = min(1.0, pow(ar / targetImageAr, 1.5 * alpha)); final imageScale = 0.9 * min(1.0, pow(ar / targetImageAr, 1.5 * alpha));
return Material( return Material(
borderOnForeground: false, borderOnForeground: false,
type: MaterialType.transparency, type: MaterialType.transparency,
@ -310,6 +310,7 @@ class FrontCard extends StatelessWidget {
syncDuration: Duration.zero, syncDuration: Duration.zero,
), ),
), ),
if (card.mnemo?.isNotEmpty == true)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
final sp = await SharedPreferences.getInstance(); final sp = await SharedPreferences.getInstance();