Dart
Google's client-optimized language behind Flutter — sound null safety, async built in, and a gentle learning curve.
22 មេរៀន
Dart
ចាប់ផ្តើមវគ្គសិក្សាGetting Started
- What is Dart?What Dart is, why Google built it, and where it fits alongside Flutter and the wider app-development landscape.
- Setting Up DartInstalling the Dart SDK and understanding the tools — dart run, dart compile, and dart format — you'll use throughout this course.
- Your First Dart ProgramThe anatomy of a Dart file — main(), statements, comments, and how the language reads top to bottom.
Variables, Types & Operators
Control Flow
- If, Else, and ConditionalsBranching logic with if/else, ternary expressions, and Dart's pattern-aware if-case syntax.
- Loopsfor, while, do-while, and for-in loops, plus break and continue for controlling iteration.
- Switch StatementsMatching a value against multiple cases with switch — and the safer, more expressive switch expression form.
Functions
Collections & Null Safety
- ListsCreating, modifying, and transforming ordered collections with Dart's List type.
- Sets and MapsStoring unique values with Set and key-value pairs with Map, and when to reach for each over a List.
- Null Safety in DepthA closer look at ?, !, and late — how Dart eliminates null-reference errors at compile time instead of runtime.
Object-Oriented Dart
- Classes and ObjectsDefining classes with fields and methods, creating instances, and the this keyword.
- ConstructorsDefault constructors, named constructors, initializer lists, and factory constructors.
- Inheritance and InterfacesSharing behavior with extends, defining contracts with implements, and reusing code across unrelated classes with mixins.
- Getters and SettersComputing derived values and controlling how a field can be written, without changing how it's used from the outside.
- GenericsWriting type-safe, reusable classes and functions with generic type parameters.
Async, Errors & Best Practices
- Futures and async/awaitHandling values that aren't ready yet with Future, and writing asynchronous code that reads like synchronous code.
- Streams BasicsHandling a sequence of asynchronous values over time with Stream, and consuming one with await for.
- Exception HandlingThrowing, catching, and designing your own exceptions with try, catch, on, and finally.
- Dart Best PracticesHabits around null safety, immutability, naming, and tooling that separate idiomatic Dart from code that merely compiles.