How to spread a list in dart

Question

Asked by TSR on February 15, 2019 (source).

In Javascript I would use a spread operator:

enter image description here

Now I have the same problem with Flutter:

 Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        MyHeader(),
        _buildListOfWidgetForBody(), // <- how to spread this <Widget>[] ????
        MyCustomFooter(),
      ],
    );
  }

Answer

Question answered by ikben (source).

You can now do spreading from Dart 2.3

var a = [0,1,2,3,4];
var b = [6,7,8,9];
var c = [...a,5,...b];

print(c);  // prints: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
DART FLUTTER
SHARE: