Skip to content

Commit

Permalink
improved root page code
Browse files Browse the repository at this point in the history
  • Loading branch information
gokadzev committed May 18, 2023
1 parent 0ef0a9b commit 5f8a68d
Showing 1 changed file with 20 additions and 39 deletions.
59 changes: 20 additions & 39 deletions lib/screens/root_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,27 +173,7 @@ class AppState extends State<Musify> {
artworkHeight: 55,
artworkFit: BoxFit.cover,
keepOldArtwork: true,
nullArtworkWidget: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
color: colorScheme.secondary,
),
child: const Column(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Icon(
FluentIcons.music_note_1_24_regular,
size: 30,
color: Colors.white,
),
],
),
),
),
nullArtworkWidget: _buildNullArtworkWidget(),
)
: ClipRRect(
borderRadius: BorderRadius.circular(8),
Expand All @@ -203,24 +183,7 @@ class AppState extends State<Musify> {
width: 55,
height: 55,
errorWidget: (context, url, error) =>
Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: colorScheme.secondary,
),
child: const Column(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Icon(
FluentIcons.music_note_1_24_regular,
size: 30,
color: Colors.white,
),
],
),
),
_buildNullArtworkWidget(),
),
),
),
Expand Down Expand Up @@ -321,6 +284,24 @@ class AppState extends State<Musify> {
);
}

Widget _buildNullArtworkWidget() => ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
color: colorScheme.secondary,
),
child: const Center(
child: Icon(
FluentIcons.music_note_1_24_regular,
size: 30,
color: Colors.white,
),
),
),
);

Widget _buildBottomBar(BuildContext context, List<BottomNavBarItem> items) {
return AnimatedContainer(
duration: const Duration(milliseconds: 100),
Expand Down

0 comments on commit 5f8a68d

Please sign in to comment.