feat: 长按删除搜索记录

This commit is contained in:
guozhigq
2023-11-11 23:39:54 +08:00
parent d105718fbf
commit 96523a99ce
3 changed files with 36 additions and 16 deletions

View File

@ -4,8 +4,14 @@ class SearchText extends StatelessWidget {
final String? searchText;
final Function? onSelect;
final int? searchTextIdx;
const SearchText(
{super.key, this.searchText, this.onSelect, this.searchTextIdx});
final Function? onLongSelect;
const SearchText({
super.key,
this.searchText,
this.onSelect,
this.searchTextIdx,
this.onLongSelect,
});
@override
Widget build(BuildContext context) {
@ -18,6 +24,9 @@ class SearchText extends StatelessWidget {
onTap: () {
onSelect!(searchText);
},
onLongPress: () {
onLongSelect!(searchText);
},
borderRadius: BorderRadius.circular(6),
child: Padding(
padding: