0Pricing
Dart Academy · Lesson

The dynamic and Object Types

Understand Dart's top types and when they fit.

Dart Has Top Types Too

Sometimes you need a variable that can hold any value. Dart offers two such top types: Object and dynamic.

Object Holds Anything Safely

An Object can store any non-null value, but Dart still checks every method call against the Object type.

Object thing = 42;
thing = "now text";

All lessons in this course

  1. var, final, and const Explained
  2. The Core Types: int, double, String, bool
  3. Type Inference vs Explicit Types
  4. The dynamic and Object Types
← Back to Dart Academy