✨ Post detail
This commit is contained in:
@ -97,6 +97,7 @@ class AuthProvider extends GetConnect {
|
||||
);
|
||||
|
||||
Get.find<AccountProvider>().connect();
|
||||
Get.find<AccountProvider>().notifyPrefetch();
|
||||
|
||||
return credentials!;
|
||||
}
|
||||
@ -105,6 +106,8 @@ class AuthProvider extends GetConnect {
|
||||
_cacheUserProfileResponse = null;
|
||||
|
||||
Get.find<AccountProvider>().disconnect();
|
||||
Get.find<AccountProvider>().notifications.clear();
|
||||
Get.find<AccountProvider>().notificationUnread.value = 0;
|
||||
|
||||
storage.deleteAll();
|
||||
}
|
||||
|
@ -1,11 +1,27 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/services.dart';
|
||||
|
||||
class PostExploreProvider extends GetConnect {
|
||||
class PostProvider extends GetConnect {
|
||||
@override
|
||||
void onInit() {
|
||||
httpClient.baseUrl = ServiceFinder.services['interactive'];
|
||||
}
|
||||
|
||||
Future<Response> listPost(int page) => get('/api/feed?take=${10}&offset=$page');
|
||||
Future<Response> listPost(int page) async {
|
||||
final resp = await get('/api/feed?take=${10}&offset=$page');
|
||||
if (resp.statusCode != 200) {
|
||||
throw Exception(resp.body);
|
||||
}
|
||||
|
||||
return resp;
|
||||
}
|
||||
|
||||
Future<Response> getPost(String alias) async {
|
||||
final resp = await get('/api/posts/$alias');
|
||||
if (resp.statusCode != 200) {
|
||||
throw Exception(resp.body);
|
||||
}
|
||||
|
||||
return resp;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user