From 531fae64f94b21551a7a0da363a9ab0d44f5d3b1 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Thu, 8 Sep 2022 23:28:16 +0600 Subject: [PATCH] feat(synced-lyrics): animated active text size --- lib/components/Lyrics/SyncedLyrics.dart | 33 +++++++++++++------------ 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/components/Lyrics/SyncedLyrics.dart b/lib/components/Lyrics/SyncedLyrics.dart index 1610460e..838c91d6 100644 --- a/lib/components/Lyrics/SyncedLyrics.dart +++ b/lib/components/Lyrics/SyncedLyrics.dart @@ -221,22 +221,23 @@ class SyncedLyrics extends HookConsumerWidget { : Center( child: Padding( padding: const EdgeInsets.all(8.0), - child: AutoSizeText( - lyricSlice.text, - maxLines: 2, - style: Theme.of(context) - .textTheme - .headline4 - ?.copyWith( - color: isActive - ? Colors.white - : palette.bodyTextColor, - // indicating the active state of that lyric slice - fontWeight: isActive - ? FontWeight.bold - : null, - ), - textAlign: TextAlign.center, + child: AnimatedDefaultTextStyle( + duration: const Duration( + milliseconds: 250), + style: TextStyle( + color: isActive + ? Colors.white + : palette.bodyTextColor, + fontWeight: isActive + ? FontWeight.bold + : FontWeight.normal, + fontSize: isActive ? 30 : 26, + ), + child: Text( + lyricSlice.text, + maxLines: 2, + textAlign: TextAlign.center, + ), ), ), ),