如何在 flutter 中动态添加 Row children?

How can i add Row children dynamically in flutter?

如何根据从调用屏幕获得的输入动态添加行子项。可以说我从传递给当前屏幕的调用屏幕中得到了五个。如何在加载页面之前添加 5 行子项。

return Scaffold(
  body: SafeArea(
    child: Column(
      children: [
        Row(
          children: [
            QuestionIconsWiget(size, 1),
            QuestionIconsWiget(size, 2),
            QuestionIconsWiget(size, 3),
            QuestionIconsWiget(size, 4),
          ],
        )
      ],
    ),
  ),
);


Expanded QuestionIconsWiget(Size size, int questionNo) {
      return Expanded(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Column(
            children: [
              Container(
                height: size.height * 0.02,
                decoration: BoxDecoration(
                  color: Colors.black,
                  shape: BoxShape.rectangle,
                  borderRadius: BorderRadius.circular(8),
                ),
              ),
              SizedBox(
                height: size.height * 0.01,
              ),
              Text(questionNo.toString()),
            ],
          ),
        ),
      );
    }
  }

// 创建Widget列表

List<Widget> widgets = [Text("1"), Text("2")];

// 将其替换为 var

Row(children: widgets)

//按下按钮或任何动作

setState(() {
          widgets.add(Text("3"));
        });