5541171e94
- models/playlist.dart (Playlist, PlaylistTrack, PlaylistDetail) - api/endpoints/playlists.dart (list with kind=user|system|all, get detail) - playlists/playlists_provider.dart (Riverpod family providers) - playlists/playlists_list_screen.dart (with system-variant pill) - playlists/playlist_detail_screen.dart (header + Play button + rows) - /playlists + /playlists/:id routes wired - Home AppBar: queue_music icon next to Search Tracks with track_id=null render greyed-out + struck-through (matches web's PlaylistTrackRow behavior). Tap a row plays from that position; top-level Play button plays the full playable subset from track 0.
20 lines
680 B
Dart
20 lines
680 B
Dart
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import '../api/endpoints/playlists.dart';
|
|
import '../library/library_providers.dart' show dioProvider;
|
|
import '../models/playlist.dart';
|
|
|
|
final playlistsApiProvider = FutureProvider<PlaylistsApi>((ref) async {
|
|
return PlaylistsApi(await ref.watch(dioProvider.future));
|
|
});
|
|
|
|
final playlistsListProvider =
|
|
FutureProvider.family<List<Playlist>, String>((ref, kind) async {
|
|
return (await ref.watch(playlistsApiProvider.future)).list(kind: kind);
|
|
});
|
|
|
|
final playlistDetailProvider =
|
|
FutureProvider.family<PlaylistDetail, String>((ref, id) async {
|
|
return (await ref.watch(playlistsApiProvider.future)).get(id);
|
|
});
|