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( : Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AutoSizeText( child: AnimatedDefaultTextStyle(
lyricSlice.text, duration: const Duration(
maxLines: 2, milliseconds: 250),
style: Theme.of(context) style: TextStyle(
.textTheme
.headline4
?.copyWith(
color: isActive color: isActive
? Colors.white ? Colors.white
: palette.bodyTextColor, : palette.bodyTextColor,
// indicating the active state of that lyric slice
fontWeight: isActive fontWeight: isActive
? FontWeight.bold ? FontWeight.bold
: null, : FontWeight.normal,
fontSize: isActive ? 30 : 26,
), ),
child: Text(
lyricSlice.text,
maxLines: 2,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
), ),
),
); );
}, },
), ),