fix: Show search bar during loading of selector views

This commit is contained in:
Alberto Ponces 2022-09-12 00:36:18 +01:00
parent 6665095b2e
commit d01e7fdcc2
2 changed files with 53 additions and 53 deletions

View file

@ -35,29 +35,29 @@ class _AppSelectorViewState extends State<AppSelectorView> {
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: <Widget>[
SearchBar(
showSelectIcon: false,
hintText: FlutterI18n.translate(
context,
'appSelectorView.searchBarHint',
),
onQueryChanged: (searchQuery) {
setState(() {
_query = searchQuery;
});
},
),
const SizedBox(height: 12),
Expanded(
child: ListView(
child: Column(
children: <Widget>[
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<AppSelectorView> {
))
.toList(),
),
),
],
),
),
],
),
),
),
),

View file

@ -37,30 +37,30 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
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: <Widget>[
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: <Widget>[
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<PatchesSelectorView> {
)
.toList(),
),
),
],
),
),
],
),
),
),
),