From ae36f7384e2ed0a4a4ae6d527825f1a225a8f993 Mon Sep 17 00:00:00 2001 From: poka Date: Mon, 5 Dec 2022 02:25:49 +0100 Subject: [PATCH 1/3] UX: improve search: button and keyboard action --- assets/translations/en.json | 2 +- assets/translations/es.json | 2 +- assets/translations/fr.json | 2 +- lib/screens/search.dart | 19 ++++++++++++++++--- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/assets/translations/en.json b/assets/translations/en.json index a46a889..0b98c48 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -169,7 +169,7 @@ "deleteThisWallet": "Delete this wallet", "cancel": "Cancel", "inBlockchainResult": "In {} blockchain", - "search": "Search", + "search": "Search an identity\nor an address", "currencyNode": "{} node :", "contactsManagementWithNbr": "My contacts ({})", "contactsManagement": "My contacts", diff --git a/assets/translations/es.json b/assets/translations/es.json index b8a6a03..262d239 100644 --- a/assets/translations/es.json +++ b/assets/translations/es.json @@ -170,7 +170,7 @@ "deleteThisWallet": "Borrar este monedero", "cancel": "Cancelar", "inBlockchainResult": "En la blockchain {}", - "search": "Buscar", + "search": "Buscar una identidad\no una dirección", "currencyNode": "Nodo {} :", "contactsManagementWithNbr": "Mis contactos ({})", "contactsManagement": "Mis contactos", diff --git a/assets/translations/fr.json b/assets/translations/fr.json index d3510bf..06ce1cb 100644 --- a/assets/translations/fr.json +++ b/assets/translations/fr.json @@ -170,7 +170,7 @@ "deleteThisWallet": "Supprimer ce portefeuille", "cancel": "Annuler", "inBlockchainResult": "Dans la blockchain {}", - "search": "Rechercher", + "search": "Rechercher une identité\nou une adresse", "currencyNode": "Noeud {} :", "contactsManagementWithNbr": "Mes contacts ({})", "contactsManagement": "Mes contacts", diff --git a/lib/screens/search.dart b/lib/screens/search.dart index 50f9009..a8e7b34 100644 --- a/lib/screens/search.dart +++ b/lib/screens/search.dart @@ -18,6 +18,7 @@ class SearchScreen extends StatelessWidget { Widget build(BuildContext context) { final searchProvider = Provider.of(context); final screenHeight = MediaQuery.of(context).size.height; + String callback() => 'tata'; // final _homeProvider = // Provider.of(context, listen: false); @@ -51,6 +52,17 @@ class SearchScreen extends StatelessWidget { Padding( padding: const EdgeInsets.symmetric(horizontal: 17), child: TextField( + onSubmitted: searchProvider.searchController.text.length >= 2 + ? (_) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) { + return const SearchResultScreen(); + }), + ); + } + : (value) {}, + textInputAction: TextInputAction.search, key: keySearchField, controller: searchProvider.searchController, autofocus: true, @@ -89,8 +101,8 @@ class SearchScreen extends StatelessWidget { ), const Spacer(flex: 1), SizedBox( - width: 410, - height: 70, + width: 320, + height: 90, child: ElevatedButton( key: keyConfirmSearch, style: ElevatedButton.styleFrom( @@ -109,8 +121,9 @@ class SearchScreen extends StatelessWidget { : null, child: Text( 'search'.tr(), + textAlign: TextAlign.center, style: const TextStyle( - fontSize: 24, fontWeight: FontWeight.w600), + fontSize: 21, fontWeight: FontWeight.w600), ), ), ), From 1ea3be788e55592ac89a57ed867ff69217c8f1bd Mon Sep 17 00:00:00 2001 From: poka Date: Mon, 5 Dec 2022 02:29:52 +0100 Subject: [PATCH 2/3] bump 0.0.14+43 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 99d6f98..18d05bc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ description: Pay with G1. # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 0.0.13+42 +version: 0.0.14+43 environment: sdk: '>=2.12.0 <3.0.0' From 8b3ecae62fd571d6f4743f31dc40d08886222c2c Mon Sep 17 00:00:00 2001 From: poka Date: Mon, 5 Dec 2022 02:34:51 +0100 Subject: [PATCH 3/3] CI fix: The declaration 'callback' isn't referenced --- lib/screens/search.dart | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/screens/search.dart b/lib/screens/search.dart index a8e7b34..3ccc490 100644 --- a/lib/screens/search.dart +++ b/lib/screens/search.dart @@ -18,9 +18,6 @@ class SearchScreen extends StatelessWidget { Widget build(BuildContext context) { final searchProvider = Provider.of(context); final screenHeight = MediaQuery.of(context).size.height; - String callback() => 'tata'; - // final _homeProvider = - // Provider.of(context, listen: false); return WillPopScope( onWillPop: () {