Dart supports the spread operator, which allows to insert multiple elements into a collection.
For instance, from the cascade I described yesterday, this
return someVariable.toList() ..add(anotherObject) ..addAll(anotherListOfObjects);
return [ ...someVariable.toList(), anotherObject, ...anotherListOfObjects ];
Even more concise and easier to read.
Subscribe to a curated newsletter
Receive an email every week with curated content about Dart and Flutter.