From db18d1c890425b7a3fc4a6f885d7394819d57420 Mon Sep 17 00:00:00 2001 From: Elias Bonnici Date: Tue, 30 Jan 2024 15:35:51 +0100 Subject: [PATCH] Clear accounts search on ESC. --- lib/oath/views/oath_screen.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/oath/views/oath_screen.dart b/lib/oath/views/oath_screen.dart index 6bf95c47..a8e89bfb 100755 --- a/lib/oath/views/oath_screen.dart +++ b/lib/oath/views/oath_screen.dart @@ -375,6 +375,13 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> { node.focusInDirection(TraversalDirection.down); return KeyEventResult.handled; } + if (event.logicalKey == LogicalKeyboardKey.escape) { + searchController.clear(); + ref.read(searchProvider.notifier).setFilter(''); + node.unfocus(); + setState(() {}); + return KeyEventResult.handled; + } return KeyEventResult.ignored; }, child: Builder(builder: (context) {