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