Check out example codes for "foreach loop in list in dart". It will help you in understanding the concepts better.

Code Example 1

main() {
    List<String> list = new List<String>();
    list.add('one');
    list.add('two');
    list.add('twelve');
    list.forEach((element) => print(element));

    Set<String> set = Set.from(list);
    set.forEach((element) => print(element));    
}

Learn ReactJs, React Native from akashmittal.com