← Flutter & Dart learning pathFlutter & Dart · Module 2 of 10
Dart language basics
Learn variables, types, functions and null safety in Dart.
📖 Key ideas
- var, final and const declare variables.
- Types: int, double, String, bool, List, Map.
- Functions: int add(int a, int b) => a + b;
- Null safety: String? may be null; String cannot.
- 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