From d01e7fdcc284a57655a99865976052704f38237a Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Mon, 12 Sep 2022 00:36:18 +0100 Subject: [PATCH] fix: Show search bar during loading of selector views --- .../views/app_selector/app_selector_view.dart | 52 +++++++++--------- .../patches_selector_view.dart | 54 +++++++++---------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index e1ea3acb..44cb9150 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -35,29 +35,29 @@ class _AppSelectorViewState extends State { child: Padding( padding: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 12.0), - child: model.noApps - ? Center( - child: I18nText('appSelectorCard.noAppsLabel'), - ) - : model.apps.isEmpty - ? const AppSkeletonLoader() - : Column( - children: [ - SearchBar( - showSelectIcon: false, - hintText: FlutterI18n.translate( - context, - 'appSelectorView.searchBarHint', - ), - onQueryChanged: (searchQuery) { - setState(() { - _query = searchQuery; - }); - }, - ), - const SizedBox(height: 12), - Expanded( - child: ListView( + child: Column( + children: [ + SearchBar( + showSelectIcon: false, + hintText: FlutterI18n.translate( + context, + 'appSelectorView.searchBarHint', + ), + onQueryChanged: (searchQuery) { + setState(() { + _query = searchQuery; + }); + }, + ), + const SizedBox(height: 12), + Expanded( + child: model.noApps + ? Center( + child: I18nText('appSelectorCard.noAppsLabel'), + ) + : model.apps.isEmpty + ? const AppSkeletonLoader() + : ListView( padding: const EdgeInsets.only(bottom: 80), children: model .getFilteredApps(_query) @@ -74,9 +74,9 @@ class _AppSelectorViewState extends State { )) .toList(), ), - ), - ], - ), + ), + ], + ), ), ), ), diff --git a/lib/ui/views/patches_selector/patches_selector_view.dart b/lib/ui/views/patches_selector/patches_selector_view.dart index e99de0f6..b68cb707 100644 --- a/lib/ui/views/patches_selector/patches_selector_view.dart +++ b/lib/ui/views/patches_selector/patches_selector_view.dart @@ -37,30 +37,30 @@ class _PatchesSelectorViewState extends State { child: Padding( padding: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 12.0), - child: model.patches.isEmpty - ? Center( - child: CircularProgressIndicator( - color: Theme.of(context).colorScheme.primary, - ), - ) - : Column( - children: [ - SearchBar( - showSelectIcon: true, - hintText: FlutterI18n.translate( - context, - 'patchesSelectorView.searchBarHint', - ), - onQueryChanged: (searchQuery) { - setState(() { - _query = searchQuery; - }); - }, - onSelectAll: (value) => model.selectAllPatches(value), - ), - const SizedBox(height: 12), - Expanded( - child: ListView( + child: Column( + children: [ + SearchBar( + showSelectIcon: true, + hintText: FlutterI18n.translate( + context, + 'patchesSelectorView.searchBarHint', + ), + onQueryChanged: (searchQuery) { + setState(() { + _query = searchQuery; + }); + }, + onSelectAll: (value) => model.selectAllPatches(value), + ), + const SizedBox(height: 12), + Expanded( + child: model.patches.isEmpty + ? Center( + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.primary, + ), + ) + : ListView( padding: const EdgeInsets.only(bottom: 80), children: model .getQueriedPatches(_query) @@ -160,9 +160,9 @@ class _PatchesSelectorViewState extends State { ) .toList(), ), - ), - ], - ), + ), + ], + ), ), ), ),