← Flutter & Dart learning path
Flutter & Dart · Module 2 of 10

Dart language basics

Learn variables, types, functions and null safety in Dart.

📖 Key ideas

  1. var, final and const declare variables.
  2. Types: int, double, String, bool, List, Map.
  3. Functions: int add(int a, int b) => a + b;
  4. Null safety: String? may be null; String cannot.
  5. String interpolation: "Hello $name".
💡 Real-life example: Null safety is a seat belt: the compiler stops you driving off with a missing value.
finalSet once at runtime
constCompile-time constant
String?Nullable string
=>Arrow function shorthand