I have a simple ListView.builder
which create each item in its own widget
the parent, stateful (using a futureBuilder) :
child: ListView.builder(
itemCount: snapshot.data.length,
itemBuilder: (context, index) {
Conversation conversation = snapshot.data[index];
return ConversationSingle(
conversation: conversation,
);
},
This part is working fine.
Now, I need to delete some of those widget by tapping another widget (classic)
the children, stateful too:
child: GestureDetector(
onTap: () async {
bool deleted =
await MyWS().delete(widget.conversation);
print(deleted); // todo refresh parentlist
},
child: SvgPicture.asset(
getAssetImage('corbeille.svg'),
),
),
Usualy, i would have pass a param inside the children to refresh the list thanks to a ValueChanged
and using a simple column (i wasn't using any ListView
before)
But here, data are displayed thanks the itemBuilder
, and I can't really get how to refresh my list.