refa: follow page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-21 20:17:45 +08:00
parent e6e9ce7d57
commit 8b28a31d09
9 changed files with 271 additions and 424 deletions

View File

@@ -1,3 +1,5 @@
import 'package:PiliPlus/http/loading_state.dart';
import '../models/follow/result.dart';
import 'index.dart';
@@ -20,4 +22,22 @@ class FollowHttp {
return {'status': false, 'msg': res.data['message']};
}
}
static Future<LoadingState<List<FollowItemModel>?>> followingsNew(
{int? vmid, int? pn, int? ps, String? orderType}) async {
var res = await Request().get(Api.followings, queryParameters: {
'vmid': vmid,
'pn': pn,
'ps': ps,
'order': 'desc',
'order_type': orderType,
});
if (res.data['code'] == 0) {
return LoadingState.success(
FollowDataModel.fromJson(res.data['data']).list);
} else {
return LoadingState.error(res.data['message']);
}
}
}