Check out example codes for "generate method o dart list". It will help you in understanding the concepts better.

Code Example 1

var list = new List<int>.generate(10, (i) => i + 1);

Learn ReactJs, React Native from akashmittal.com