fixed range error add item from another list flutter code example
Example: flutter count list
var comments = <Comment>[...];
var count = comments.where((c) => c.product_id == someProductId).toList().length;
var comments = <Comment>[...];
var count = comments.where((c) => c.product_id == someProductId).toList().length;