If you want to add the widgets dynamically to column in Flutter? If you have the comments data already, simply create a List, then pass it to the children property of the Column. Something like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | var commentWidgets = List<Widget>(); for (var comment in comments) { commentWidgets.Add(Text(comment.text)); } … new Expanded( child: new ListView( shrinkWrap: true, children: <Widget>[ // Title new Padding(padding: const EdgeInsets.only( top: 10.00, left: 10.00), child: new Text( _feed.title, textAlign: TextAlign.start,), ), // content new Container( child: new Text( _feed.content, textAlign: TextAlign.start,), ), // Comments List will go here Column(children: commentWidgets,), ], ), ), |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.