feat: 我的关注 正在直播
This commit is contained in:
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/http/live.dart';
|
||||
import 'package:pilipala/models/live/follow.dart';
|
||||
import 'package:pilipala/models/live/item.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
@ -11,6 +12,8 @@ class LiveController extends GetxController {
|
||||
int _currentPage = 1;
|
||||
RxInt crossAxisCount = 2.obs;
|
||||
RxList<LiveItemModel> liveList = <LiveItemModel>[].obs;
|
||||
RxList<LiveFollowingItemModel> liveFollowingList =
|
||||
<LiveFollowingItemModel>[].obs;
|
||||
bool flag = false;
|
||||
OverlayEntry? popupDialog;
|
||||
Box setting = GStrorage.setting;
|
||||
@ -44,6 +47,7 @@ class LiveController extends GetxController {
|
||||
// 下拉刷新
|
||||
Future onRefresh() async {
|
||||
queryLiveList('init');
|
||||
fetchLiveFollowing();
|
||||
}
|
||||
|
||||
// 上拉加载
|
||||
@ -61,4 +65,17 @@ class LiveController extends GetxController {
|
||||
duration: const Duration(milliseconds: 500), curve: Curves.easeInOut);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
Future fetchLiveFollowing() async {
|
||||
var res = await LiveHttp.liveFollowing(pn: 1, ps: 20);
|
||||
if (res['status']) {
|
||||
liveFollowingList.value = (res['data'].list
|
||||
as List<LiveFollowingItemModel>)
|
||||
.where(
|
||||
(LiveFollowingItemModel item) => item.liveStatus == 1) // 根据条件过滤
|
||||
.toList();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user