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
- var, final, and const Explained
- The Core Types: int, double, String, bool
- Type Inference vs Explicit Types
- The dynamic and Object Types