Check out example codes for "flutter count list". It will help you in understanding the concepts better.

Code Example 1

var comments = <Comment>[...];
var count = comments.where((c) => c.product_id == someProductId).toList().length;

Learn ReactJs, React Native from akashmittal.com