From 0340f6f64b00034c926064d45f4a73c3fd4a7a02 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Tue, 18 Jun 2024 09:28:11 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index f051ef4a8..ab26d201d 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,18 @@ flutter: These configurations will generate **`assets.gen.dart`** under the **`lib/gen/`** directory by default. +#### Flavored assets + +Flutter supports +[Conditionally bundling assets based on flavor](https://docs.flutter.dev/deployment/flavors#conditionally-bundling-assets-based-on-flavor). +Assets are only available with flavors if specified. +`flutter_gen` will generate the specified `flavors` for assets regardless the current flavor. +The `flavors` field accessible though `.flavors`, for example: + +```dart +print(MyAssets.images.chip4.flavors); // -> {'extern'} +``` + #### Excluding generating for assets You can specify `flutter_gen > assets > exclude` using `Glob` patterns to exclude particular assets.