Flutter listview with Map instead of List

Its a little late but You could also try this.
Map values = snapshot.data;

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,
        ),
      ],
    );
  },
);

for a more detailed example check this out
https://kodestat.gitbook.io/flutter/39-flutter-listviewbuilder-using-dart-maps

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)