From reading about Dart to writing it. Every concept gets practiced immediately.
Press J anytime to jump to any section. Arrow keys to navigate.
Click what you read. If you didn't read — that's ok, we cover everything from scratch today.
var, final, const — how to store values
+, -, *, /, ==, &&, || — the math of Dart
// How you leave notes in your code
💡 Even if you didn't read — that's totally fine. Everything is taught from scratch today.
You put a value inside. Give it a name. Use that name to get the value later anywhere in your code.
Both mean the value cannot change. The only difference is when the value is decided.
The value is decided when the app runs — but once set, you can never change it.
Like your final exam grade — the teacher gives it to you when results are out. Once written, it never changes.
The value must be known before the app even starts. Pure fixed numbers or text only.
Like the number of days in a week — always 7, forever, decided before anything. That's a const.
📌 Simple rule: use final almost everywhere. Use const only for fixed values like limits, names, math constants.
Every variable has a type — the kind of data it holds.
List uses [ ] — Map uses { key: value } — Set uses { value }
📌 .map() transforms items · .where() filters items · .forEach() loops without creating a new list
Strings are text. Dart makes working with them easy and readable.
Dart's way of making sure your app never crashes from an empty variable.
Imagine you ask "what's in the mailbox?" — and there IS no mailbox. Your app crashes. Null means "nothing is there".
Memory trick: No ? = box is always full. Add ? = box might be empty (handle it).
3 quick questions on what we just covered. Think carefully before clicking.
final and const?String? mean??? do?Red → stop. Green → go. Yellow → slow. Code makes the same kind of branching decisions.
📌 Use if/else for multi-line logic. Use the ternary for quick one-liner assignments.
3 more questions. Think carefully before clicking.
~/ do?Ingredients = parameters in. Steps = code inside. Dish = return value out.
📌 Rule: if you write void, don't return anything. If you write int/String, you must return that type.
required means you must pass it. Without required, a default value is used.
📌 Use => when your function body is a single expression. It automatically returns the result.
Final 3 questions. You've got this!
void mean?=> do?Class = blueprint on paper. Object = the actual house built from it. One blueprint → many houses, all different families.
📌 A class defines what something has (properties) and how to create it (constructor).
Methods are functions that belong to a class — things an object can do.
Dart 3 lets you control how others can use your classes. Think of it as setting rules on your blueprint.
Imagine you built a house blueprint. Class modifiers let you say: "You can look at this but not copy it" or "You can only build exactly this, no changes."
Can't build directly — only a plan
Use when: You want a base class that forces children to implement methods
Extend ✅ Implement ❌
Use when: You want others to extend your class but keep your internal implementation
Implement ✅ Extend ❌
Use when: You want a contract — "promise to have these methods"
No extend, no implement — locked
Use when: Your class should never be changed or subclassed
Limited family — compiler checks all cases
Use when: You want a fixed set of types (great with switch)
Share behavior without inheritance
Use when: Multiple classes need the same ability
📌 Start simple: use final for most classes. Add abstract when you need a base class. You'll use sealed a lot with Flutter state management.
Add items, see totals update. Uses everything you learned: List, Map, class, methods, loops.
Every feature shows the Dart code + which concepts it uses. All of today's topics in one project!
The phone UI is just a preview of what's coming with Flutter. Try to guess the number!
Every concept here is a building block. Flutter uses all of them — starting next week.
var, final, const · String? · ??
String, int, bool, List, Map · .map() .where() .forEach()
$var, ${expr}, trim, split, contains
Arithmetic, comparison, logical, null-aware ??
if/else, ternary, for, while, break, continue
void, return, named params, arrow =>
Blueprint, constructor, methods, getter
abstract, base, final, sealed, interface, mixin
No question is too basic. If you're confused, someone else is too — ask now.
Practice on dartpad.dev — try the Student Report Card yourself!