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