Fix minor UX annoyances in search bar

This commit is contained in:
franzap
2024-10-22 17:58:37 -03:00
parent 3f18f35777
commit b3fa325fe7
+2
View File
@@ -35,6 +35,7 @@ class SearchScreen extends HookConsumerWidget {
child: SearchBar(
controller: controller,
focusNode: focusNode,
onTapOutside: (_) => focusNode.unfocus(),
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(28),
@@ -82,6 +83,7 @@ class SearchScreen extends HookConsumerWidget {
WidgetStateProperty.all(TextStyle(color: Colors.grey[600])),
elevation: WidgetStateProperty.all(2.2),
onSubmitted: (query) async {
if (query.isEmpty) return;
ref.read(searchQueryProvider.notifier).state = query;
scrollController.animateTo(
scrollController.position.minScrollExtent,