Skip to content

Commit

Permalink
custom app bar OK
Browse files Browse the repository at this point in the history
  • Loading branch information
odrevet committed Mar 11, 2021
1 parent b870ff2 commit 6e9816c
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions lib/widgets/now_playing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,36 @@ class _SongNowPlayingAppBarState extends State<SongNowPlayingAppBar> {
if (songNowPlaying.year != 0) subtitle += ' • ${songNowPlaying.year}';
subtitle += ' • ${songNowPlaying.program.name}';

Widget title = RichText(
text: TextSpan(
text: songNowPlaying.name,
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 20),
children: <TextSpan>[
TextSpan(
text: '\n$subtitle',
style: TextStyle(
color: Colors.black,
fontSize: 12),
),
],
),
);
Widget title;

if (widget._orientation == Orientation.portrait) {
} else {}
title = RichText(
text: TextSpan(
text: songNowPlaying.name,
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 20),
children: <TextSpan>[
TextSpan(
text: '\n$subtitle',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.normal,
fontSize: 14),
),
],
),
);
} else {
title = Text(
'${songNowPlaying.name} • ${subtitle}',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 20),
);
}

return AppBar(title: title);
} else if (snapshot.hasError) {
Expand Down

0 comments on commit 6e9816c

Please sign in to comment.