0PricingLogin
Dart Academy · Lesson

Arrow Syntax for One-Line Functions

Shorten functions with the fat arrow.

Why Shorten Functions?

Many Dart functions just return one expression. The arrow syntax lets you write those in a single tidy line. ✨

The Fat Arrow

The => symbol, called the fat arrow, replaces the curly braces and the return keyword for one-expression bodies.

All lessons in this course

  1. Arrow Syntax for One-Line Functions
  2. Anonymous Functions and Closures
  3. Nullable Types and the Question Mark
  4. Null-Aware Operators: ?., ??, and !
← Back to Dart Academy