0PricingLogin
Dart Academy · Lesson

Spread and Null-Aware Spread

Inline one collection into another.

Combining Collections

Often you want to drop all items of one list into another. Dart's spread operator inlines a whole collection in a single move.

Meet Three Dots

The spread operator is three dots placed before a collection inside a list, set, or map literal. Its items pour right in.

var more = [4, 5];
var all = [1, 2, 3, ...more];

All lessons in this course

  1. The Cascade Operator (..)
  2. Null-Shorting Cascades (?..)
  3. Spread and Null-Aware Spread
  4. Collection if and for
← Back to Dart Academy