Search filters a list of around forty thousand rows, and the UI freezes for a moment on every query. I figured async was the fix, so the filter became this and the tap handler awaits it.
Future<List<Entry>> filterRows(List<Entry> rows, String query) async {
final out = <Entry>[];
for (final r in rows) {
if (r.matches(query)) out.add(r);
}
return out;
}
// in the tap handler
setState(() => loading = true);
final result = await filterRows(allRows, query);
Same freeze. The spinner I turn on right before the call doesn't even show up. I know Isolate.run exists, I've used it for a big JSON decode, but it felt like a lot for a filter, and I thought await was supposed to keep frames going while it waits. What is the await actually doing here?