Is there a way to give custom id to every item in flutter's listview?
I need to update a single item in flutter listview by its id or key.
Why I want to update by Id?
because I want to update a specific item without rebuilding the entire listview items, this may boost performance of my app.
I guess you can just use itemBuilder
's index since it's not repetitive.
return ListView.builder(
itemCount: items.length,
itemBuilder: (context, int index) {
return ListTile(key: new Key(index.toString()));...
},
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With