From 9bf73c1bc51e07d7bc84c391047a3efff204579f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Fri, 21 Jun 2024 13:08:40 +0200 Subject: [PATCH] feat: make other views correctly scrollable --- lib/views/album_view.dart | 71 ++++++++++++++++++++------------------ lib/views/artist_view.dart | 3 +- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/lib/views/album_view.dart b/lib/views/album_view.dart index edeeb46..42bec00 100644 --- a/lib/views/album_view.dart +++ b/lib/views/album_view.dart @@ -36,41 +36,44 @@ class _AlbumViewState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), - body: SizedBox( - width: 100.w, - height: 100.h, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - HeroBanner( - cacheKey: widget.album.coverArtId, - imageUrl: widget.album.coverArtUrl, - title: widget.album.name, - description: widget.album.artistName, - ), - SizedBox( - height: 65.h, - width: 95.w, - child: ListView.builder( - itemBuilder: (c, i) => InkWell( - onTap: () async { - playerKey.currentState?.update(); - await AudioPlayerService().playNow( - queueNext: _songs.getRange(i, _songs.length).toList(), - queuePast: (i == 0) ? [] : _songs.getRange(0, i).toList(), - ); - - setState(() {}); - }, - child: SongRow( - imageUrl: _songs[i].coverArtUrl, - songTitle: _songs[i].title, - ), - ), - itemCount: _songs.length, + body: Align( + alignment: Alignment.topCenter, + child: SizedBox( + width: 100.w, + height: 90.h, + child: Column( + children: [ + HeroBanner( + cacheKey: widget.album.coverArtId, + imageUrl: widget.album.coverArtUrl, + title: widget.album.name, + description: widget.album.artistName, ), - ), - ], + SizedBox( + height: 46.h, + width: 95.w, + child: ListView.builder( + itemBuilder: (c, i) => InkWell( + onTap: () async { + playerKey.currentState?.update(); + await AudioPlayerService().playNow( + queueNext: _songs.getRange(i, _songs.length).toList(), + queuePast: + (i == 0) ? [] : _songs.getRange(0, i).toList(), + ); + + setState(() {}); + }, + child: SongRow( + imageUrl: _songs[i].coverArtUrl, + songTitle: _songs[i].title, + ), + ), + itemCount: _songs.length, + ), + ), + ], + ), ), ), ); diff --git a/lib/views/artist_view.dart b/lib/views/artist_view.dart index bfa0ebb..b6b8cae 100644 --- a/lib/views/artist_view.dart +++ b/lib/views/artist_view.dart @@ -51,7 +51,8 @@ class _ArtistViewState extends State { description: "This could be a cool description soon", heroTag: widget.artist.name, ), - Center( + Align( + alignment: Alignment.topCenter, child: SizedBox( height: 70.h, width: 95.w,