How do you update a listview in a flutter android home screen widget?

42 Views Asked by At

I'm doing the typical todo list project to learn flutter and wanted to have a go at making a home screen widget for android.

I've not done much work on android but I don't see a way to update a listview in the widget? It seems straightforward enough if I just want to update a text box, but more complicated layouts seem unsupported.

Is this the case or am I missing something?

1

There are 1 best solutions below

1
Patel Rajesh On

You can use ListView.builder() to prepare the ListView and just return any customWidget from itemBuilder.

return ListView.builder(
    itemCount: 10,
    shrinkWrap: true,
    itemBuilder: (BuildContext context, int index) => Container(),
);