write list in model flutter code example
Example 1: add list fromflutter
ListView(
children: <Widget>[
ListTile(
leading: Icon(Icons.map),
title: Text('Map'),
),
ListTile(
leading: Icon(Icons.photo_album),
title: Text('Album'),
),
ListTile(
leading: Icon(Icons.phone),
title: Text('Phone'),
),
],
);
Example 2: flutter count list
var comments = <Comment>[...];
var count = comments.where((c) => c.product_id == someProductId).toList().length;