11import 'package:dururu/models/pagination.dart' ;
22import 'package:dururu/models/subsonic.dart' ;
33import 'package:dururu/presentation/widgets/album_grid.dart' ;
4- import 'package:dururu/presentation/widgets/loading_indicator .dart' ;
4+ import 'package:dururu/presentation/widgets/song_trailing .dart' ;
55import 'package:dururu/providers/audio.dart' ;
66import 'package:dururu/providers/subsonic_apis.dart' ;
7- import 'package:flutter/cupertino .dart' ;
7+ import 'package:dururu/utils .dart' ;
88import 'package:flutter/material.dart' ;
99import 'package:flutter_riverpod/flutter_riverpod.dart' ;
1010import 'package:cached_network_image/cached_network_image.dart' ;
@@ -207,11 +207,13 @@ class _ArtistPageState extends ConsumerState<ArtistPage> {
207207 child: CachedNetworkImage (
208208 imageUrl: ref.watch (
209209 getCoverArtProvider (
210- GetCoverArtRequest (id: song.coverArt)),
210+ GetCoverArtRequest (id: song.coverArt, size: 48 ),
211+ ),
211212 ),
212- cacheKey: GetCoverArtRequest (id: song.coverArt)
213- .hashCode
214- .toString (),
213+ cacheKey:
214+ GetCoverArtRequest (id: song.coverArt, size: 48 )
215+ .hashCode
216+ .toString (),
215217 width: 48 ,
216218 height: 48 ,
217219 fit: BoxFit .cover,
@@ -221,15 +223,9 @@ class _ArtistPageState extends ConsumerState<ArtistPage> {
221223 ),
222224 title: Text (song.title),
223225 subtitle: Text (
224- Duration (seconds: song.duration ?? 0 )
225- .toString ()
226- .split ('.' )
227- .first,
228- ),
229- trailing: IconButton (
230- icon: const Icon (CupertinoIcons .ellipsis),
231- onPressed: () {},
226+ formatSongDuration (song.duration ?? 0 ),
232227 ),
228+ trailing: SongTrailing (id: song.id),
233229 onTap: () {
234230 ref
235231 .read (audioProvider.notifier)
@@ -247,64 +243,17 @@ class _ArtistPageState extends ConsumerState<ArtistPage> {
247243 showLoading: albumState.hasMore && albumState.isLoading,
248244 )
249245 else
250- SliverList (
251- delegate: SliverChildBuilderDelegate (
252- (context, index) {
253- if (index >= songState.items.length) {
254- return songState.isLoading
255- ? const Center (
256- child: Padding (
257- padding: EdgeInsets .all (16 ),
258- child: LoadingIndicator (),
259- ),
260- )
261- : null ;
262- }
263-
264- final song = songState.items[index];
265- return ListTile (
266- leading: ClipRRect (
267- borderRadius: BorderRadius .circular (4 ),
268- child: CachedNetworkImage (
269- imageUrl: ref.watch (
270- getCoverArtProvider (
271- GetCoverArtRequest (id: song.coverArt)),
272- ),
273- cacheKey: GetCoverArtRequest (id: song.coverArt)
274- .hashCode
275- .toString (),
276- width: 48 ,
277- height: 48 ,
278- fit: BoxFit .cover,
279- placeholder: (context, url) => const Center (
280- child: LoadingIndicator (),
281- ),
282- errorWidget: (context, url, error) =>
283- const Icon (Icons .album),
284- ),
285- ),
286- title: Text (song.title),
287- subtitle: Text (
288- Duration (seconds: song.duration ?? 0 )
289- .toString ()
290- .split ('.' )
291- .first,
292- ),
293- trailing: IconButton (
294- icon: const Icon (CupertinoIcons .ellipsis),
295- onPressed: () {},
296- ),
297- onTap: () {
298- ref
299- .read (audioProvider.notifier)
300- .playQueue (songState.items, initialIndex: index);
301- },
302- );
303- },
304- childCount:
305- songState.items.length + (songState.hasMore ? 1 : 0 ),
246+ const SliverToBoxAdapter (
247+ child: SizedBox (
248+ height: 200 ,
249+ child: Center (
250+ child: Text ("Coming Soon!" ),
251+ ),
306252 ),
307253 ),
254+ const SliverToBoxAdapter (
255+ child: SizedBox (height: 120 ),
256+ ),
308257 ],
309258 ),
310259 );
0 commit comments