[FR]: Conditionally bundling assets based on flavor #494
Labels
contributions welcome
Welcome contribute
discussion
Want to discuss it
enhancement
New feature or request
Milestone
Is there an existing issue for this?
Version
5.4.0
Command type
build_runner (Default)
What happened?
With the new flutter version 3.19, conditionally bundling assets based on flavor was introduced. As the name suggests, this allows for bundling assets contionally based on flavor of the app. docs
When using flutter_gen to build assets I get the following exception:
FlutterGen v5.4.0 Loading ... my-app/pubspec.yaml Unhandled exception: CheckedFromJsonException Could not create
Flutter. There is a problem with "assets". type 'YamlMap' is not a subtype of type 'String' in type cast #0 $checkedConvert (package:json_annotation/src/checked_helpers.dart:91:5) #1 $checkedCreate.checkedConvert (package:json_annotation/src/checked_helpers.dart:28:7) #2 _$FlutterFromJson.<anonymous closure> (package:flutter_gen_core/settings/pubspec.g.dart:38:34) #3 $checkedCreate.<anonymous closure> (package:json_annotation/src/checked_helpers.dart:33:22) #4 $checkedNew (package:json_annotation/src/checked_helpers.dart:51:23) #5 $checkedCreate (package:json_annotation/src/checked_helpers.dart:30:10) #6 _$FlutterFromJson (package:flutter_gen_core/settings/pubspec.g.dart:29:40) #7 new Flutter.fromJson (package:flutter_gen_core/settings/pubspec.dart:40:41) #8 _$PubspecFromJson.<anonymous closure>.<anonymous closure> (package:flutter_gen_core/settings/pubspec.g.dart:22:57) #9 $checkedConvert (package:json_annotation/src/checked_helpers.dart:87:20) #10 $checkedCreate.checkedConvert (package:json_annotation/src/checked_helpers.dart:28:7) #11 _$PubspecFromJson.<anonymous closure> (package:flutter_gen_core/settings/pubspec.g.dart:22:30) #12 $checkedCreate.<anonymous closure> (package:json_annotation/src/checked_helpers.dart:33:22) #13 $checkedNew (package:json_annotation/src/checked_helpers.dart:51:23) #14 $checkedCreate (package:json_annotation/src/checked_helpers.dart:30:10) #15 _$PubspecFromJson (package:flutter_gen_core/settings/pubspec.g.dart:9:40) #16 new Pubspec.fromJson (package:flutter_gen_core/settings/pubspec.dart:15:41) #17 loadPubspecConfig (package:flutter_gen_core/settings/config.dart:28:27) #18 loadPubspecConfigOrNull (package:flutter_gen_core/settings/config.dart:34:12) #19 FlutterGenerator.build (package:flutter_gen_core/flutter_generator.dart:25:16) #20 main (file:///Users/myuser/.pub-cache/hosted/pub.dev/flutter_gen-5.4.0/bin/flutter_gen_command.dart:48:49) #21 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:294:33) #22 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)
How my assets are defined in pubspec.yaml
`
flutter:
uses-material-design: true
`
is this not supported?
Relevant a pubspec.yaml.
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: