how to create list in flutter code example Example: generate list flutter List<int>.generate(3, (int index) => index * index); // [0, 1, 4]