dart list model code example
Example 1: last element in list dart
var lst = ["element1" , "element2" , "element3"];
lst.last // -> element3
Example 2: flutter count list
var comments = <Comment>[...];
var count = comments.where((c) => c.product_id == someProductId).toList().length;