Open troncomputers opened 3 years ago
I cannot reproduce this, at least using the example in the latest pr #46 . Are you perhaps recreating the state too often, which would cause a new search bar to be created?
I've changed things a little bit. onChanged()
is not async anymore. As you can see I'm setting the state on every key pressed
onChanged: (value) {
if (!["", null, false, 0].contains(value)) {
var customers = customersService.getCustomersFromBox();
var filteredCustomers = customers
.where((element) =>
element.code.toLowerCase().contains(value.toLowerCase()) ||
(element.name1 + " " + element.name2 + " " + element.name3).toLowerCase().contains(value.toLowerCase()) ||
element.vatNumber!.toLowerCase().contains(value.toLowerCase()))
.toList();
setState(() {
_customers = Future.value(filteredCustomers);
});
}
},
Is that the issue?
Hi! Would you guys be able to look at this. Inside scaffold's body I have a FutureBuilder and I'm filtering data in
onChanged()
function.Function
onClosed()
is fired only when I tap on "back" icon provided by this plugin.