return Scaffold(
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Stack(
children: <Widget>[
Column(
children: <Widget>[
NewsBlock(
size: size,
dataList: dataList,
imgNum: 1,
titleNum: 11,
urlNum: 21,
),
NewsBlock(
size: size,
dataList: dataList,
imgNum: 2,
titleNum: 12,
urlNum: 22,
),
NewsBlock(
size: size,
dataList: dataList,
imgNum: 3,
titleNum: 13,
),
NewsBlock(
size: size,
dataList: dataList,
imgNum: 4,
titleNum: 14,
),
],
)
],
),
],
)),
);
I want to make that long code to short with for loop. But I don't know how to use for loop in flutter.. I think I can reduce the length of code by putting i in imgNum, titleNum, and urlNum and increasing i. How can I do that? (btw there are 10 news blocks and I didn't write urlNum for all news blocks yet because typing all them made me feel like a fool)