following users page

This commit is contained in:
wgh19
2024-05-13 20:01:23 +08:00
parent 56917f22c1
commit 13ef786280
5 changed files with 121 additions and 5 deletions

View File

@@ -324,4 +324,16 @@ class Network {
return Res.error(res.errorMessage);
}
}
Future<Res<List<UserPreview>>> getFollowing(String uid, String type, [String? nextUrl]) async {
var path = nextUrl ?? "/v1/user/following?filter=for_android&user_id=$uid&restrict=$type";
var res = await apiGet(path);
if (res.success) {
return Res(
(res.data["user_previews"] as List).map((e) => UserPreview.fromJson(e["user"])).toList(),
subData: res.data["next_url"]);
} else {
return Res.error(res.errorMessage);
}
}
}