“dart-language”
Reusing Construction Logic with Named, Factory, and Redirecting Constructors in Dart
Named constructors add clarity, redirecting constructors reuse logic, and factory constructors cache or validate. Choose the right one in Dart 3.
Grouping Related Behavior with Static Members and Constants in Dart
Static variables, static const, and static methods group class-wide state in Dart — learn lazy init, const interplay, and when top-level wins.
Encapsulating Data with Getters and Setters in Dart
Every property access in Dart is really a getter or setter call. Learn to declare computed properties, validate writes, and hide fields behind them.
Modeling Objects with Classes, Constructors, and Initializing Formals in Dart
Model real objects in Dart with fields, constructors, this.x initializing formals, initializer lists, final fields, and const canonicalization.
Capturing Variables with Closures and Function Tear-Offs in Dart
Learn how Dart closures capture variables by reference, how loop closures bind per iteration, and how tear-offs replace redundant lambdas in Dart.
Returning Values with Arrow Functions and Expression Bodies in Dart
Dart's => arrow syntax is shorthand for { return expr; }. Learn where expression bodies shine, when to use block bodies instead, and how tear-offs beat lambdas.
Setting Defaults and Marking Parameters as Required in Dart
How Dart parameter defaults must be compile-time constants, why optional params are nullable, and when to use required named parameters instead of defaults.
Defining Dart Functions with Positional and Named Parameters
Positional, optional positional, and named parameters explained with ordering rules, trailing commas, Flutter's named style, and Effective Dart API design advice.
Jumping Out of Loops with break, continue, and Labels in Dart
Use break and continue to control Dart loops, then level up with labeled statements to exit or skip specific outer loops in nested for, while, and do-while.
Walking Through Collections with for-in Loops in Dart
Master Dart's for-in loop: iterate Lists, Sets and Maps, destructure with patterns, dodge mutation hazards, and choose between for-in, forEach, and where.
Repeating Work with for, while, and do-while Loops in Dart
C-style for, closures that capture values not variables, for-in over iterables, while versus do-while, side-effect conditions, break, labels, and forEach etiquette.
Decision Logic in Dart: if/else, if-case, and switch Statements
From plain if/else through Dart 3 if-case, switch statements, switch expressions, guards, and exhaustiveness checking over enums and sealed classes.
Understanding Equality in Dart: ==, identical(), and the hashCode Contract
How Dart's == really works, when identical() beats it, how const canonicalization surprises you, and the rules for overriding == and hashCode together.
Applying Arithmetic, Relational, Logical, and Null-Aware Operators in Dart
The full Dart operator precedence table, arithmetic and bitwise families, logical and null-aware operators, plus the gotchas that make parentheses mandatory.
Escaping Characters and Unicode in Dart String Literals
Escape sequences, raw strings, runes, and the grapheme-cluster trap: a practical guide to Unicode-correct Dart strings for emoji, flags, and paths.
Building Strings in Dart with Interpolation, Raw Literals and Line Breaks
Master Dart strings: $interpolation, ${expressions}, adjacent literals, triple-quoted blocks and r-prefixed raw strings for regexes and Windows paths.
Working with num and Converting Between Integers and Doubles in Dart
num unifies Dart's two number types. Learn / vs ~/ vs %, int.parse and double.parse, toStringAsFixed, and the truncation traps inside toInt().
Getting to Know Dart's Core Types: int, double, bool and String
From 64-bit ints to UTF-16 strings, meet Dart's four everyday types: their literals, platform limits, literal inference, and why bool has no truthiness.
Choosing Between final and const for Immutable Values in Dart
final can be set once at runtime; const must be fixed at compile time. Learn the rules, const canonicalization, and when the const keyword is redundant.
Declaring Variables in Dart and Letting Inference Pick the Type with var
Dart's var keyword infers a type from the initializer. Learn how inference works, when Effective Dart wants an explicit annotation, and where it stops.