now search page will show everything

This commit is contained in:
Andrew 2022-09-13 11:57:31 +07:00
parent baa8dabc35
commit 0ae0729c6d

View file

@ -89,6 +89,10 @@ class _AppSearchFragmentState extends State<AppSearchFragment> {
} }
Widget _buildLoadedBody(ScoopSearchLoaded state) { Widget _buildLoadedBody(ScoopSearchLoaded state) {
final flattenedApps = state.apps.entries
.map((e) => e.value)
.expand((i) => i)
.toList(growable: false);
return Flex( return Flex(
direction: Axis.horizontal, direction: Axis.horizontal,
children: [ children: [
@ -97,9 +101,9 @@ class _AppSearchFragmentState extends State<AppSearchFragment> {
child: ListView.builder( child: ListView.builder(
key: PageStorageKey(state.apps.length), key: PageStorageKey(state.apps.length),
controller: scrollController, controller: scrollController,
itemCount: state.apps["main"]?.length ?? 0, itemCount: flattenedApps.length,
itemBuilder: (context, index) => itemBuilder: (context, index) =>
_createAppWidget(state.apps["main"]![index]), _createAppWidget(flattenedApps[index]),
).backgroundColor(Colors.black.withAlpha(50)), ).backgroundColor(Colors.black.withAlpha(50)),
), ),
Expanded( Expanded(