You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we need to obtain more animation details, we can use the `parse_animation` option. This will automatically parse all animation information for GIFs and WebP files, including frames, duration, etc. As this option significantly increases generation time, it's disabled by default and needs to be manually enabled.
345
+
346
+
```yaml
347
+
flutter_gen:
348
+
parse_animation: true # <- Add this line (default: false)
349
+
# This option implies parse_metadata: true
350
+
```
351
+
352
+
For GIF and WebP animation, several new nullable field is added to the
353
+
generated class. For example:
354
+
355
+
```dart
356
+
AssetGenImage get animated =>
357
+
const AssetGenImage(
358
+
'assets/images/animated.webp',
359
+
size: Size(209.0, 49.0),
360
+
isAnimation: true,
361
+
duration: Duration(milliseconds: 1000),
362
+
frames: 15,
363
+
);
364
+
```
365
+
343
366
#### Usage Example
344
367
345
368
[FlutterGen] generates [Image](https://api.flutter.dev/flutter/widgets/Image-class.html) class if the asset is Flutter supported image format.
@@ -575,7 +598,9 @@ Plugin issues that are not specific to [FlutterGen] can be filed in the [Flutter
575
598
### Known Issues
576
599
577
600
#### Bad State: No Element when using build_runner
601
+
578
602
If you get an error message like this:
603
+
579
604
```
580
605
[SEVERE] flutter_gen_runner:flutter_gen_runner on $package$:
0 commit comments