mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: show clear search history dialog
related #359 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -165,7 +165,7 @@ class Utils {
|
||||
),
|
||||
);
|
||||
}
|
||||
} catch (e) {}
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user