mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-26 16:46:51 +08:00
SearchDelegate: Remove it when pressing 'x'
Usually 'x' just clears the query, but if there is no query it is strange that nothing happens on pressing it.
This commit is contained in:
@ -31,7 +31,11 @@ class NoteSearchDelegate extends SearchDelegate<Note> {
|
||||
IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
onPressed: () {
|
||||
if (query.isEmpty) {
|
||||
close(context, null);
|
||||
} else {
|
||||
query = '';
|
||||
}
|
||||
},
|
||||
),
|
||||
];
|
||||
|
Reference in New Issue
Block a user