add element to an already existing list from another class 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;