Want to spread a list in dart? You don’t, at the moment. But you can build a List from it and insert/add the other elements on the go.
1 2 3 4 5 6 7 8 9 | Widget build(BuildContext context) { final List<Widget> columnWidgets = List.from(_buildListOfWidgetForBody()) ..insert(0, MyHeader()) ..add(MyCustomFooter()); return Column( children: columnWidgets ); } |
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.