mod: show clear search history dialog

related #359

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-03 11:40:21 +08:00
parent a9f9b324a9
commit 432c5133e6
2 changed files with 10 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
import 'package:PiliPlus/common/widgets/dialog.dart';
import 'package:PiliPlus/http/loading_state.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -132,8 +133,14 @@ class SSearchController extends GetxController {
}
onClearHistory() {
historyList.clear();
GStorage.historyWord.put('cacheList', []);
showConfirmDialog(
context: Get.context!,
title: '确定清空搜索历史?',
onConfirm: () {
historyList.clear();
GStorage.historyWord.put('cacheList', []);
},
);
}
@override

View File

@@ -165,7 +165,7 @@ class Utils {
),
);
}
} catch (e) {}
} catch (_) {}
}
}