Tooling, Testing & Production
จาก code สู่แอปที่ ship จริง
หัวข้อที่มีชื่อว่า “จาก code สู่แอปที่ ship จริง”การเขียน widget เป็นแค่ครึ่งเดียวของงาน อีกครึ่งคือเครื่องมือรอบ ๆ code ของคุณ: toolchain ที่รัน code ของคุณ, test ที่พิสูจน์ว่าทำงาน, build mode ที่แปลง Dart เป็น native binary ที่เร็ว และเรื่อง production ที่ตัดสินว่า user จริงจะมีวันที่ดีหรือไม่
โมดูลนี้คือครึ่งหลังนั้น — ส่วนที่แยก demo ออกจาก product
โมดูลนี้ครอบคลุมอะไรบ้าง
หัวข้อที่มีชื่อว่า “โมดูลนี้ครอบคลุมอะไรบ้าง”| บทเรียน | สิ่งที่คุณจะได้เรียน |
|---|---|
| Project & tooling | pubspec.yaml, flutter CLI, DevTools และ hot reload vs hot restart |
| Testing | unit, widget, integration และ golden test |
| Build & release | debug/profile/release mode, JIT vs AOT, flavor, output แต่ละ platform |
| Production concerns | error handling, crash reporting, profiling และ CI/CD |
รูปร่างของ workflow
หัวข้อที่มีชื่อว่า “รูปร่างของ workflow”flowchart LR dev["develop (hot reload)"] --> test["test (unit/widget/golden)"] test --> build["build (release, AOT)"] build --> ship["ship (monitor, profile, CI/CD)"]
แต่ละ stage มีเครื่องมือของตัวเองและ failure mode ของตัวเอง เส้นเรื่องหลัก: Flutter optimize หนักมากเพื่อ inner loop ที่เร็ว (hot reload) แล้วสลับไปใช้ compilation strategy คนละแบบเลย (AOT) ตอน release — เข้าใจการแยกนี้แล้วจะเข้าใจ tooling เกือบทั้งหมด