♻️ Migrated to riverpod v3

This commit is contained in:
2025-12-06 13:00:30 +08:00
parent fd79c11d18
commit 9d03faf594
158 changed files with 6834 additions and 10357 deletions

View File

@@ -11,16 +11,18 @@ final postAwardListNotifierProvider = AsyncNotifierProvider.autoDispose
PostAwardListNotifier.new,
);
class PostAwardListNotifier
extends AutoDisposeFamilyAsyncNotifier<List<SnPostAward>, String>
with FamilyAsyncPaginationController<SnPostAward, String> {
static const int _pageSize = 20;
class PostAwardListNotifier extends AsyncNotifier<List<SnPostAward>>
with AsyncPaginationController<SnPostAward> {
static const int pageSize = 20;
final String arg;
PostAwardListNotifier(this.arg);
@override
Future<List<SnPostAward>> fetch() async {
final client = ref.read(apiClientProvider);
final queryParams = {'offset': fetchedCount, 'take': _pageSize};
final queryParams = {'offset': fetchedCount, 'take': pageSize};
final response = await client.get(
'/sphere/posts/$arg/awards',
@@ -50,7 +52,7 @@ class PostAwardHistorySheet extends HookConsumerWidget {
return Column(
children: [
PostAwardItem(award: award),
if (index < (ref.read(provider).valueOrNull?.length ?? 0) - 1)
if (index < (ref.read(provider).value?.length ?? 0) - 1)
const Divider(height: 1),
],
);