feat(flutter): systemPlaylistsStatusProvider
Riverpod FutureProvider that reads the caller's system-playlists build state. Consumed by the home Playlists row to decide between real and placeholder cards. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
|
import '../api/endpoints/me.dart';
|
||||||
import '../api/endpoints/playlists.dart';
|
import '../api/endpoints/playlists.dart';
|
||||||
import '../library/library_providers.dart' show dioProvider;
|
import '../library/library_providers.dart' show dioProvider;
|
||||||
import '../models/playlist.dart';
|
import '../models/playlist.dart';
|
||||||
|
import '../models/system_playlists_status.dart';
|
||||||
|
|
||||||
final playlistsApiProvider = FutureProvider<PlaylistsApi>((ref) async {
|
final playlistsApiProvider = FutureProvider<PlaylistsApi>((ref) async {
|
||||||
return PlaylistsApi(await ref.watch(dioProvider.future));
|
return PlaylistsApi(await ref.watch(dioProvider.future));
|
||||||
@@ -17,3 +19,9 @@ final playlistDetailProvider =
|
|||||||
FutureProvider.family<PlaylistDetail, String>((ref, id) async {
|
FutureProvider.family<PlaylistDetail, String>((ref, id) async {
|
||||||
return (await ref.watch(playlistsApiProvider.future)).get(id);
|
return (await ref.watch(playlistsApiProvider.future)).get(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final systemPlaylistsStatusProvider =
|
||||||
|
FutureProvider<SystemPlaylistsStatus>((ref) async {
|
||||||
|
final dio = await ref.watch(dioProvider.future);
|
||||||
|
return MeApi(dio).systemPlaylistsStatus();
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user