# State lifecycle và AnimationController

> initState, didUpdateWidget, dispose, mounted; AnimationController với TickerProvider; implicit animation so với controller tự cầm.

- URL: https://dantech.academy/courses/flutter-mobile-101/02-widget-essentials/lesson-08-state-lifecycle-and-animation
- Khóa học: [Flutter Mobile 101](https://dantech.academy/courses/flutter-mobile-101.md)
- Module: Widget Fundamentals
- Thời lượng: 18 phút
- Độ khó: beginner
- Truy cập: Dành cho học viên

## Mục tiêu

- Gọi đúng initState, didUpdateWidget, dispose và biết việc gì thuộc về từng mốc
- Dựng một AnimationController đúng chuẩn và dọn nó sạch khi widget rời cây
- Chọn giữa animation ẩn và controller theo đúng câu hỏi quyết định

## Nội dung bài học

1. State Lifecycle
2. Khuôn Animation Của Repo, Lặp Mười Hai Lần
3. Hai Cái Bẫy Repo Đã Viết Comment Sẵn
4. didUpdateWidget: Phản Ứng Với Dữ Liệu Mới
5. Implicit Animations: Khi Bạn Không Cần Controller
6. Khung Quyết Định
7. Thuật Ngữ

## Học cùng AI agent

Toàn bộ bài học dành cho học viên của khóa. Học viên mở bài trên web và bấm nút **Markdown** để copy toàn bài, rồi dán vào Claude, ChatGPT, Cursor hoặc agent bạn đang dùng. Nhanh hơn: tạo token ở `/profile/ai-agents` và agent đọc bài trực tiếp qua MCP.

- [Đăng ký khóa học](https://dantech.academy/flutter-mobile-101/checkout)

---

- Bài trước: [BuildContext và InheritedWidget](https://dantech.academy/courses/flutter-mobile-101/02-widget-essentials/lesson-07-buildcontext-and-inherited-widget.md)
- Bài tiếp theo: [MVVM: Model, View, ViewModel in Flutter](https://dantech.academy/courses/flutter-mobile-101/03-mvvm/lesson-01-why-mvvm-and-three-layers.md)
