Skip to content

Commit dbc01db

Browse files
authored
🧪 Test exclude keys with - (#529)
Indicates #509 🎯
1 parent e81ecd5 commit dbc01db

File tree

4 files changed

+35
-19
lines changed

4 files changed

+35
-19
lines changed

‎.idea/runConfigurations/Run_on_flutter_gen_command.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎README.md

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
<p align="center">
22
<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"/>
44
</a>
55
</p>
66
<p align="center">
77
<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">
99
</a>
1010
<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"/>
1212
</a>
1313
<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"/>
1815
</a>
1916
</p>
2017

@@ -147,7 +144,9 @@ flutter:
147144
148145
### Assets
149146
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.
151150
No other specific configuration is required.
152151
_Ignore duplicated._
153152
@@ -168,6 +167,21 @@ flutter:
168167
169168
These configurations will generate **`assets.gen.dart`** under the **`lib/gen/`** directory by default.
170169

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+
171185
#### Generate for packages
172186

173187
If you want to generate assets for a package,
@@ -323,15 +337,13 @@ Widget build(BuildContext context) {
323337

324338
**Available Integrations**
325339

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()** |
333346

334-
<br/>
335347

336348
In other cases, the asset is generated as String class.
337349

@@ -409,6 +421,7 @@ Text(
409421
fontFamily: FontFamily.robotoMono,
410422
fontFamilyFallback: const [FontFamily.raleway],
411423
),
424+
)
412425
```
413426

414427
[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
468481
Plugin issues that are not specific to [FlutterGen] can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new).
469482

470483
### Known Issues
484+
471485
#### Bad State: No Element when using build_runner
472486
If you get an error message like this:
473487
```
1.37 KB
Loading

‎examples/example/pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ flutter_gen:
5252

5353
exclude:
5454
- assets/images/chip3/chip3.jpg
55+
- assets-extern/*
5556
- pictures/chip5.jpg
56-
- assets/flare/
5757

5858
fonts:
5959
enabled: true
@@ -82,14 +82,15 @@ flutter:
8282
- assets/images/icons/paint.svg
8383
- assets/images/icons/[email protected]
8484
- assets/json/
85-
- pictures/chip5.jpg
8685
- assets/flare/
8786
- assets/rive/
8887
- assets/lottie/
8988
- assets/lottie/wrong/
9089
- assets/movie/
9190
- assets/unknown/
9291
- assets/mix/
92+
- assets-extern/
93+
- pictures/chip5.jpg
9394
fonts:
9495
- family: Raleway
9596
fonts:

0 commit comments

Comments
 (0)