feat(synced-lyrics): animated active text size

This commit is contained in:
Kingkor Roy Tirtho 2022-09-08 23:28:16 +06:00
parent 64226a7344
commit 531fae64f9

View File

@ -221,25 +221,26 @@ 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(
child: AnimatedDefaultTextStyle(
duration: const Duration(
milliseconds: 250),
style: TextStyle(
color: isActive
? Colors.white
: palette.bodyTextColor,
// indicating the active state of that lyric slice
fontWeight: isActive
? FontWeight.bold
: null,
: FontWeight.normal,
fontSize: isActive ? 30 : 26,
),
child: Text(
lyricSlice.text,
maxLines: 2,
textAlign: TextAlign.center,
),
),
),
),
);
},
),