1
1
<p align =" center " >
2
2
<a href =" https://pub.dev/packages/flutter_gen " >
3
- <img src="https://github.com/FlutterGen/flutter_gen/raw/main/art/logo.png" width="480px"/>
3
+ <img src="https://github.com/FlutterGen/flutter_gen/raw/main/art/logo.png" width="480px" alt="Logo" />
4
4
</a >
5
5
</p >
6
6
<p align =" center " >
7
7
<a href =" https://pub.dartlang.org/packages/flutter_gen " >
8
- <img src="https://img.shields.io/pub/v/flutter_gen.svg">
8
+ <img src="https://img.shields.io/pub/v/flutter_gen.svg" alt="Pub" >
9
9
</a >
10
10
<a href =" https://github.com/FlutterGen/flutter_gen/actions?query=workflow%3A%22Dart+CI%22 " >
11
- <img src="https://github.com/FlutterGen/flutter_gen/workflows/Dart%20CI /badge.svg" />
11
+ <img src="https://github.com/FlutterGen/flutter_gen/workflows/Build /badge.svg" alt="Build Status" />
12
12
</a >
13
13
<a href =" https://codecov.io/gh/FlutterGen/flutter_gen " >
14
- <img src="https://codecov.io/gh/FlutterGen/flutter_gen/branch/main/graph/badge.svg" />
15
- </a >
16
- <a href =" https://pub.dev/packages/lints " >
17
- <img src="https://img.shields.io/badge/style-lints-40c4ff.svg" />
14
+ <img src="https://codecov.io/gh/FlutterGen/flutter_gen/branch/main/graph/badge.svg" alt="Coverage"/>
18
15
</a >
19
16
</p >
20
17
@@ -147,7 +144,9 @@ flutter:
147
144
148
145
### Assets
149
146
150
- Just follow the doc [Adding assets and images#Specifying assets](https://flutter.dev/docs/development/ui/assets-and-images#specifying-assets) to specify assets, then [FlutterGen] will generate related dart files.
147
+ Following the doc
148
+ [Adding assets and images#Specifying assets](https://flutter.dev/docs/development/ui/assets-and-images#specifying-assets)
149
+ to specify assets, then [FlutterGen] will generate related dart files.
151
150
No other specific configuration is required.
152
151
_Ignore duplicated._
153
152
@@ -168,6 +167,21 @@ flutter:
168
167
169
168
These configurations will generate **` assets.gen.dart`** under the **`lib/gen/`** directory by default.
170
169
170
+ # ### Excluding generating for assets
171
+
172
+ You can specify `flutter_gen > assets > exclude` using `Glob` patterns to exclude particular assets.
173
+
174
+ ` ` ` yaml
175
+ flutter_gen:
176
+ assets:
177
+ outputs:
178
+ excludes:
179
+ - folder-your-want-to-exclude/*
180
+ - specified-asset.jpg
181
+ ` ` `
182
+
183
+ See more patterns with the `package:glob`.
184
+
171
185
# ### Generate for packages
172
186
173
187
If you want to generate assets for a package,
@@ -323,15 +337,13 @@ Widget build(BuildContext context) {
323
337
324
338
**Available Integrations**
325
339
326
- |Packages|File extension|Setting|Usage|
327
- |--|--|--|--|
328
- |[flutter_svg](https://pub.dev/packages/flutter_svg)|.svg| `flutter_svg : true` |Assets.images.icons.paint.**svg()**|
329
- |[flare_flutter](https://pub.dev/packages/flare_flutter)|.flr| `flare_flutter : true` |Assets.flare.penguin.**flare()**|
330
- |[rive](https://pub.dev/packages/rive)|.flr| `rive : true` |Assets.rive.vehicles.**rive()**|
331
- |[lottie](https://pub.dev/packages/lottie)|.json| `lottie : true` |Assets.lottie.hamburgerArrow.**lottie()**|
332
-
340
+ | Packages | File extension | Setting | Usage |
341
+ |---------------------------------------------------------|----------------|-----------------------|-------------------------------------------|
342
+ | [flutter_svg](https://pub.dev/packages/flutter_svg) | .svg | `flutter_svg : true` | Assets.images.icons.paint.**svg()** |
343
+ | [flare_flutter](https://pub.dev/packages/flare_flutter) | .flr | `flare_flutter : true` | Assets.flare.penguin.**flare()** |
344
+ | [rive](https://pub.dev/packages/rive) | .flr | `rive : true` | Assets.rive.vehicles.**rive()** |
345
+ | [lottie](https://pub.dev/packages/lottie) | .json | `lottie : true` | Assets.lottie.hamburgerArrow.**lottie()** |
333
346
334
- <br/>
335
347
336
348
In other cases, the asset is generated as String class.
337
349
@@ -409,6 +421,7 @@ Text(
409
421
fontFamily: FontFamily.robotoMono,
410
422
fontFamilyFallback: const [FontFamily.raleway],
411
423
),
424
+ )
412
425
```
413
426
414
427
[ Example of code generated by FlutterGen] ( https://github.com/FlutterGen/flutter_gen/tree/main/examples/example/lib/gen/fonts.gen.dart )
@@ -468,6 +481,7 @@ Please file [FlutterGen] specific issues, bugs, or feature requests in our [issu
468
481
Plugin issues that are not specific to [FlutterGen] can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new).
469
482
470
483
# ## Known Issues
484
+
471
485
# ### Bad State: No Element when using build_runner
472
486
If you get an error message like this :
473
487
` ` `
0 commit comments