Dart và Flutter Widget, MVVM, dependency injection và kiến trúc màn hình. Đọc hiểu và build được một app Flutter thật chạy trên Android và iOS.
00.01Cài Flutter SDK và flutter doctorFreeTiếp theo→ Cài Flutter SDK trên macOS, Windows, Linux, đọc từng dòng flutter doctor và xử lý các cảnh báo thường gặp.8 phút
00.02flutter create, flutter run và hot reloadFree→ flutter create, flutter run trên máy thật, cấu trúc thư mục ở mức cần thiết, và vòng lặp hot reload.6 phút
00.03Git checkpoint, clone app đích và rules file cho AIFree→ Commit theo checkpoint, clone app TicTac chạy trên máy thật, và khai stack của khóa trong rules file cho AI coding tool.8 phút
01.01var, final, named parameters và null safety→ final và var, named parameters, null safety với ?. và ??, arrow function - đủ Dart để đọc mọi dòng code trong khóa.8 phút
01.02Class, sealed class và pattern matching→ enum có field và method, class bất biến với const constructor, sealed class, switch expression với pattern matching.8 phút
01.03List, Map, Future và async/await→ map, where, take trên List, cache bằng Map, collection-for và spread trong UI, Future với async/await.8 phút
02.01Widget tree, Column, Row và Expanded→ Column, Row, GridView, Expanded, SizedBox, và cách đọc một widget tree lồng nhiều tầng.7 phút
02.02StatelessWidget, StatefulWidget và setState→ StatelessWidget với StatefulWidget, setState kích hoạt rebuild, và lifting state up khi nhiều widget dùng chung một state.7 phút
02.03collection-for, ListView.builder và Chip→ collection-for trong SingleChildScrollView, khi nào phải đổi sang ListView.builder, và nhóm chip chọn sinh từ enum.values.7 phút
02.04BoxConstraints, Expanded và LayoutBuilder→ constraints go down, sizes go up, parent sets position; tight, loose và unbounded constraints; Expanded, AspectRatio, ConstrainedBox, FittedBox, LayoutBuilder, SafeArea.8 phút
02.05Stack, Positioned và IgnorePointer→ Stack với Positioned, IgnorePointer cho lớp trang trí, ClipRRect cắt góc, RepaintBoundary cô lập vẽ lại.8 phút
02.06Widget, Element, RenderObject→ Ba nhánh của Element.updateChild, Widget.canUpdate, key quyết định State giữ hay mất, const đưa rebuild vào nhánh bỏ qua.8 phút
02.07BuildContext và InheritedWidget→ BuildContext là node trong element tree, .of(context) tra ngược lên cây, InheritedWidget đứng sau Theme, MediaQuery và provider.8 phút
02.08State lifecycle và AnimationController→ initState, didUpdateWidget, dispose, mounted; AnimationController với TickerProvider; implicit animation so với controller tự cầm.8 phút
03.01MVVM: Model, View, ViewModel in Flutter→ Ba giới hạn của setState khi app vượt một màn hình, trách nhiệm của Model, ViewModel, View, và tầng domain không import Flutter.7 phút
03.02Immutable model và sealed class→ MatchRecord với == viết tay, ScoreBoard trả instance mới thay vì sửa tại chỗ, sealed class bốn nhánh cho một lần đọc dữ liệu, và bài test đầu tiên.7 phút
03.03ChangeNotifier và ListenableBuilder→ Ba ViewModel từ mỏng tới dày, ListenableBuilder nối View không cần thư viện ngoài, và dispose() đóng cả một lớp bug.7 phút
04.01Provider, MultiProvider và context.watch→ provider dựng trên InheritedWidget, MultiProvider ở composition root, và bốn cách đọc: watch, read, select, Consumer.7 phút
04.02Dependency injection và composition root→ buildProviders() đọc từng khối, vì sao không ViewModel nào ở app scope, vì sao repo không dùng ChangeNotifierProxyProvider, và hai seam Clock với Random.8 phút
04.03Provider scope, Fake và fake_async→ Scope quyết định vòng đời, ProviderNotFoundException khi nào là tin tốt, Fake viết tay thay mock framework, và test ViewModel có Timer bằng fake_async.7 phút
05.01Navigator stack và screen state machine→ Navigator stack làm gì, vì sao app TicTac đổi màn bằng enum năm giá trị thay vì push và pop, và seam ScreenNavigator một method.7 phút
05.02AppShell, ValueKey và PopScope→ MaterialApp dựng trong AppShell, AppViewModel provide ở shell chứ không app-wide, switch exhaustive chọn màn, ValueKey remount, PopScope cho nút back Android.7 phút
05.03ViewModel scope và shared repository→ Hai màn đọc chung repository thay vì gọi nhau, constructor mở ván nên điều hướng là đủ, hiệu ứng ăn mừng sống ở shell, và bảng quyết định state nào đặt ở đâu.7 phút
06.01SharedPreferencesAsync và repository pattern→ Seam KeyValueStore, adapter SharedPreferencesAsync, JSON codec có số version, và repository làm nguồn sự thật với bốn nhánh đọc fail-soft.8 phút
06.02main(), runApp và ráp toàn bộ app→ main() load dữ liệu trước runApp, năm màn nối nhau ra sao, cây thư mục khi mọi thư mục đã có lý do, và checklist ranh giới tầng kiểm được bằng lệnh.8 phút
06.03ColorScheme, debug và flutter build→ Hai ColorScheme viết tay thay vì sinh từ một màu, motion token tập trung, ba kỹ năng debug, chín thứ trông như bug mà không phải, và lệnh build cho Android lẫn iOS.8 phút
🎮 TicTac — Flutter Cross PlatformCodebaseTic-Tac-Toe built on Flutter which showcases the full Flutter development skills: Widget, Navigation, Confetti Animation, Widget Animation, Native bridge, ... Hope you can learn something cool from it.
NEWTài liệu mới đang trên đường tớiCập nhật liên tụcTemplate, checklist, source mới sẽ xuất hiện ngay tại đây.