opt: func

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-07 13:07:15 +08:00
parent 6353ecc13e
commit 286193f08f
99 changed files with 204 additions and 270 deletions

View File

@@ -11,8 +11,8 @@ class HistoryBaseController extends GetxController {
RxInt checkedCount = 0.obs;
// 清空观看历史
Future onClearHistory(BuildContext context, VoidCallback onSuccess) async {
await showDialog(
void onClearHistory(BuildContext context, VoidCallback onSuccess) {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
@@ -40,8 +40,8 @@ class HistoryBaseController extends GetxController {
}
// 暂停观看历史
Future onPauseHistory(BuildContext context) async {
await showDialog(
void onPauseHistory(BuildContext context) {
showDialog(
context: context,
builder: (context) {
return AlertDialog(

View File

@@ -102,7 +102,7 @@ class HistoryController extends MultiSelectController<HistoryData, HisListItem>
}
// 删除某条历史记录
Future delHistory(HisListItem item) async {
void delHistory(HisListItem item) {
_onDelete([item]);
}
@@ -166,7 +166,7 @@ class HistoryController extends MultiSelectController<HistoryData, HisListItem>
),
),
TextButton(
onPressed: () async {
onPressed: () {
Get.back();
if (loadingState.value is Success) {
_onDelete(((loadingState.value as Success).response

View File

@@ -238,9 +238,7 @@ class _HistoryPageState extends State<HistoryPage>
}
Widget get _buildPage => refreshIndicator(
onRefresh: () async {
await _historyController.onRefresh();
},
onRefresh: _historyController.onRefresh,
child: CustomScrollView(
physics: const AlwaysScrollableScrollPhysics(),
controller: _historyController.scrollController,