♻️ Refactor riverpod pagination loading

This commit is contained in:
2025-05-15 23:29:37 +08:00
parent 2759c009ad
commit dfd216b84b
28 changed files with 1018 additions and 360 deletions

View File

@ -29,7 +29,7 @@ Future<SnPublisher> publisher(Ref ref, String uname) async {
@riverpod
Future<List<SnAccountBadge>> publisherBadges(Ref ref, String pubName) async {
final pub = await ref.watch(publisherProvider(pubName).future);
if (pub.publisherType != 0) return [];
if (pub.type != 0) return [];
final apiClient = ref.watch(apiClientProvider);
final resp = await apiClient.get("/accounts/${pub.name}/badges");
return List<SnAccountBadge>.from(
@ -177,7 +177,7 @@ class PublisherProfileScreen extends HookConsumerWidget {
).fontSize(14).opacity(0.85),
],
),
if (data.publisherType == 0)
if (data.type == 0)
AccountStatusWidget(
uname: name,
padding: EdgeInsets.zero,