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,
right: 10.0.w,
bottom: 10.0.h,
top: 10.0.h,
),
child: Row(
children: [

View file

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

View file

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