Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn Flavors

Product flavor trên Windows và Linux trong Flutter 3.47

Build dev/staging/prod từng là chuyện riêng mobile. Flutter 3.47 mang flavor lên Windows và Linux . Asset theo flavor trong pubspec flutter : assets : - path : assets/flavor_a/images flavors : - flavor_a - path : assets/flavor_b/images flavors : - flavor_b Build flutter build windows --flavor flavor_a flutter build linux --flavor flavor_a Vì sao team desktop quan tâm App ID và icon tách biệt cho bản internal vs store. API base URL khác nhau không cần hack string trong Dart. CI matrix sinh được installer cạnh nhau. Cạm bẫy Ghép flavor với dart-define hoặc env compile-time — flavor tự nó không inject secret. Packaging desktop (MSIX, deb/rpm, AppImage) vẫn có luật identity riêng. Bài viết gốc đăng tại FlutterCook . Bản trên đó là bản được cập nhật mới nhất.

Product flavors on Windows and Linux in Flutter 3.47

Dev/staging/prod builds were a mobile-only story for a long time. Flutter 3.47 brings flavors to Windows and Linux . pubspec assets per flavor flutter : assets : - path : assets/flavor_a/images flavors : - flavor_a - path : assets/flavor_b/images flavors : - flavor_b Build flutter build windows --flavor flavor_a flutter build linux --flavor flavor_a Why desktop teams care Separate app IDs and icons for internal vs store builds. Different API base URLs without string hacks in Dart. CI matrix can produce side-by-side installers. Pitfalls Pair flavors with dart-define or compile-time env — flavors alone do not inject secrets. Remember desktop packaging (MSIX, deb/rpm, AppImage) still has its own identity rules. Originally published on FlutterCook . Read the latest version there — that copy is the one kept up to date.