Skip to content

Commit 4243904

Browse files
committed
Filtered list
1 parent ac20814 commit 4243904

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

lib/screens/home_page/collection_pane.dart

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class CollectionPane extends ConsumerWidget {
9393
style: Theme.of(context).textTheme.bodyMedium,
9494
hintText: "Filter by name or URL",
9595
onChanged: (value) {
96-
ref.read(searchQueryProvider.notifier).state = value;
96+
ref.read(searchQueryProvider.notifier).state =
97+
value.toLowerCase();
9798
},
9899
),
99100
),
@@ -177,7 +178,24 @@ class _RequestListState extends ConsumerState<RequestList> {
177178
);
178179
},
179180
)
180-
: SizedBox(),
181+
: ListView(
182+
padding: kPe8,
183+
controller: controller,
184+
children: requestSequence.map((id) {
185+
var item = requestItems[id]!;
186+
if (item.url.toLowerCase().contains(filterQuery) ||
187+
item.name.toLowerCase().contains(filterQuery)) {
188+
return Padding(
189+
padding: kP1,
190+
child: RequestItem(
191+
id: id,
192+
requestModel: item,
193+
),
194+
);
195+
}
196+
return const SizedBox();
197+
}).toList(),
198+
),
181199
);
182200
}
183201
}

0 commit comments

Comments
 (0)