![]() |
VOOZH | about |
In Dart, Spread Operator (...) and Null-aware Spread Operator (...?) are used for inserting multiple elements in a collection like Lists, Maps, etc.
Syntaxes:
...Data_structure
...?Data_structure
Example 1: Using spread operators with List.
Output :
[Wow, Geeks, For, Geeks, is, amazing]
Example 2: Using Spread operator with Map.
Output :
{roll no: 45, class: 12, name: John, age: 21}
Example 3: Using spread operator with Sets.
Output:
{5,4,3,2,1}