Flutter ● ○ ○ Dart 3.6

Kodebits Day 29: Cascade Notation

May 25 2026
Practice cascade notation with a short dart challenge.

What does this print?

void main() {
  final nums = <int>[]
    ..add(5)
    ..add(8)
    ..add(3);
  print(nums.length);
}


Try it in the online Dart Playground →

[spoiler title="Solution"]

Answer:

3

Explanation:

Cascade notation (..) allows chaining operations on the same object.

[/spoiler]


Further Reading