Skip to content

Commit

Permalink
feat(synced-lyrics): animated active text size
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Sep 8, 2022
1 parent 64226a7 commit 531fae6
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions lib/components/Lyrics/SyncedLyrics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
),
),
Expand Down

0 comments on commit 531fae6

Please sign in to comment.