mod: refresh

related #306

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-24 17:10:40 +08:00
parent d9ae1dd97a
commit 7f912a1781
13 changed files with 22 additions and 32 deletions

View File

@@ -64,9 +64,9 @@ abstract class CommonController extends GetxController {
scrollController.animToTop();
}
void onReload() {
Future onReload() async {
loadingState.value = LoadingState.loading();
onRefresh();
await onRefresh();
}
@override

View File

@@ -139,8 +139,7 @@ abstract class ReplyController extends CommonController {
break;
}
nextOffset = '';
loadingState.value = LoadingState.loading();
onRefresh();
onReload();
});
}

View File

@@ -162,11 +162,9 @@ class DynamicsController extends GetxController
onRefresh() async {
queryFollowUp();
await Future.wait(<Future>[
Get.find<DynamicsTabController>(
await Get.find<DynamicsTabController>(
tag: tabsConfig[tabController.index]['tag'])
.onRefresh()
]);
.onRefresh();
}
// 返回顶部并刷新

View File

@@ -50,7 +50,7 @@ class _FavSearchPageState extends State<FavSearchPage> {
onPressed: _favSearchCtr.onClear,
),
),
onSubmitted: (value) => _favSearchCtr.onRefresh(),
onSubmitted: (value) => _favSearchCtr.onReload(),
),
),
body: Obx(() => _buildBody(_favSearchCtr.loadingState.value)),

View File

@@ -67,8 +67,7 @@ class LaterController extends MultiSelectController {
count.value -= 1;
loadingState.value = LoadingState.success(list);
} else {
loadingState.value = LoadingState.loading();
onRefresh();
onReload();
}
}
Get.back();

View File

@@ -91,8 +91,7 @@ class MemberVideoCtr extends CommonController {
} else {
sort.value = sort.value == 'desc' ? 'asc' : 'desc';
}
loadingState.value = LoadingState.loading();
onRefresh();
onReload();
}
void toViewPlayAll() async {

View File

@@ -297,10 +297,7 @@ class _MemberPageNewState extends State<MemberPageNew>
Widget _errorWidget(msg) {
return errorWidget(
errMsg: msg,
callback: () {
_userController.loadingState.value = LoadingState.loading();
_userController.onRefresh();
},
callback: _userController.onReload,
);
}

View File

@@ -66,7 +66,7 @@ class _ZonePageState extends State<ZonePage>
super.build(context);
return refreshIndicator(
onRefresh: () async {
return await _zoneController.onRefresh();
await _zoneController.onRefresh();
},
child: CustomScrollView(
controller: _zoneController.scrollController,

View File

@@ -291,7 +291,7 @@ class ArticlePanelController extends GetxController {
tag: 'article${searchPanelCtr.keyword}');
ctr.order.value = item['order'];
SmartDialog.showLoading(msg: 'loading');
await ctr.onRefresh();
await ctr.onReload();
SmartDialog.dismiss();
},
bgColor: item['value'] == currentOrderFilterval.value
@@ -324,7 +324,7 @@ class ArticlePanelController extends GetxController {
tag: 'article${searchPanelCtr.keyword}');
ctr.categoryId = item['categoryId'];
SmartDialog.showLoading(msg: 'loading');
await ctr.onRefresh();
await ctr.onReload();
SmartDialog.dismiss();
},
bgColor: item['value'] == currentZoneFilterval.value

View File

@@ -217,7 +217,7 @@ class UserPanelController extends GetxController {
ctr.orderSort = item['orderSort'];
ctr.order.value = item['order'];
SmartDialog.showLoading(msg: 'loading');
await ctr.onRefresh();
await ctr.onReload();
SmartDialog.dismiss();
},
bgColor: item['value'] == currentOrderFilterval.value
@@ -250,7 +250,7 @@ class UserPanelController extends GetxController {
tag: 'bili_user${searchPanelCtr.keyword}');
ctr.userType = item['userType'];
SmartDialog.showLoading(msg: 'loading');
await ctr.onRefresh();
await ctr.onReload();
SmartDialog.dismiss();
},
bgColor: item['value'] == currentUserTypeFilterval.value

View File

@@ -51,7 +51,7 @@ Widget searchVideoPanel(context, ctr, LoadingState loadingState) {
ctr.order.value =
i['type'].toString().split('.').last;
SmartDialog.showLoading(msg: 'loading');
await ctr.onRefresh();
await ctr.onReload();
SmartDialog.dismiss();
},
),
@@ -257,7 +257,7 @@ class VideoPanelController extends GetxController {
1000;
setState(() {});
SmartDialog.showLoading(msg: 'loading');
await ctr.onRefresh();
await ctr.onReload();
SmartDialog.dismiss();
}
});
@@ -334,7 +334,7 @@ class VideoPanelController extends GetxController {
1000;
}
SmartDialog.showLoading(msg: 'loading');
await ctr.onRefresh();
await ctr.onReload();
SmartDialog.dismiss();
},
bgColor: item['value'] == currentPubTimeFilterval
@@ -384,7 +384,7 @@ class VideoPanelController extends GetxController {
tag: 'video${searchPanelCtr.keyword}');
ctr.duration.value = item['value'];
SmartDialog.showLoading(msg: 'loading');
await ctr.onRefresh();
await ctr.onReload();
SmartDialog.dismiss();
},
bgColor: item['value'] == currentTimeFilterval
@@ -421,7 +421,7 @@ class VideoPanelController extends GetxController {
tag: 'video${searchPanelCtr.keyword}');
ctr.tids = item['tids'];
SmartDialog.showLoading(msg: 'loading');
await ctr.onRefresh();
await ctr.onReload();
SmartDialog.dismiss();
},
bgColor: item['value'] == currentZoneFilterval

View File

@@ -95,7 +95,6 @@ class HorizontalMemberPageController extends CommonController {
queryBySort() {
order.value = order.value == 'pubdate' ? 'click' : 'pubdate';
loadingState.value = LoadingState.loading();
onRefresh();
onReload();
}
}

View File

@@ -197,7 +197,6 @@ class VideoReplyReplyController extends ReplyController
mode.value = mode.value == Mode.MAIN_LIST_HOT
? Mode.MAIN_LIST_TIME
: Mode.MAIN_LIST_HOT;
loadingState.value = LoadingState.loading();
onRefresh();
onReload();
}
}