最佳答案
创建一个方法。
List<Text> _myWidget(int count) {
return List.generate(count, (i) => Text("*")).toList(); // replace * with your rupee or use Icon instead
}
在 Row
中使用它,例如像这样。
Row(children: _myWidget(10));
关于flutter - 在行中重复小部件 n 次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56642355/