Flutter listview with Map instead of List
return new ListView.builder(
itemCount: values.length,
itemBuilder: (BuildContext context, int index) {
String key = values.keys.elementAt(index);
return new Column(
children: <Widget>[
new ListTile(
title: new Text("$key"),
subtitle: new Text("${values[key]}"),
),
new Divider(
height: 2.0,
),
],
);
},
);
map.forEach((key, value) {
// here you can write your logic using "Value object",
// make new object of your list view item and
// add it to it's builder list using
setState(() {
_builderList.insert(0, itemObject);
});
});
or you can try
final list = map.values.toList(growable: {true/false});
// play with your list
Copyright © 2021 Dtuto.Com