♻️ Refactored publisher subscription
This commit is contained in:
@@ -65,7 +65,7 @@ final class AppSettingsNotifierProvider
|
||||
}
|
||||
|
||||
String _$appSettingsNotifierHash() =>
|
||||
r'8e6e901b8a91f9944e1f4dd5d96507e75cd1de81';
|
||||
r'ee6b67190f3db5d8cb8a9e438a444e91685927d4';
|
||||
|
||||
abstract class _$AppSettingsNotifier extends $Notifier<AppSettings> {
|
||||
AppSettings build();
|
||||
|
||||
16
lib/pods/post/post_subscriptions.dart
Normal file
16
lib/pods/post/post_subscriptions.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:island/models/post.dart';
|
||||
import 'package:island/pods/network.dart';
|
||||
|
||||
final subscriptionsProvider = FutureProvider<List<SnPublisherSubscription>>((
|
||||
ref,
|
||||
) async {
|
||||
final client = ref.read(apiClientProvider);
|
||||
|
||||
final response = await client.get('/sphere/subscriptions');
|
||||
|
||||
return response.data
|
||||
.map((json) => SnPublisherSubscription.fromJson(json))
|
||||
.cast<SnPublisherSubscription>()
|
||||
.toList();
|
||||
});
|
||||
Reference in New Issue
Block a user