Skip to content

Commit 66f5d55

Browse files
author
Ian Maciel
committed
fixup! Add support for Flutter deferred components
1 parent 7bc1198 commit 66f5d55

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

packages/core/lib/generators/assets_generator.dart

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,11 @@ class AssetsGenConfig {
4949
flutterGen.assets.outputs.packageParameterEnabled ? _packageName : '';
5050
}
5151

52-
List<Object> _buildAssetsList(Config config) {
53-
final List<Object> deferredAssets = [];
54-
config.pubspec.flutter.deferredComponents?.forEach((deferredComponent) {
55-
// Include all manipulated assets to the list of deferred assets.
56-
deferredAssets.addAll(deferredComponent.assets ?? []);
57-
});
58-
59-
// Merge the deferred assets with the main assets.
60-
return [...config.pubspec.flutter.assets, ...deferredAssets];
61-
}
52+
/// Merge the deferred assets with the main assets.
53+
List<Object> _buildAssetsList(Config config) => [
54+
...config.pubspec.flutter.assets,
55+
...config.pubspec.flutter.deferredComponents ?? []
56+
];
6257

6358
Future<String> generateAssets(
6459
AssetsGenConfig config,

0 commit comments

Comments
 (0)