File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
packages/core/lib/generators Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -54,14 +54,11 @@ List<Object> _buildAssetsList(Config config) {
5454 // We may have several deferred components, with a list of assets for each.
5555 // So before spreading the list of deferred components, we need to spread
5656 // the list of assets for each deferred component.
57- final List <Object > deferredAssets = [];
58- config.pubspec.flutter.deferredComponents? .forEach ((deferredComponent) {
59- // Include all manipulated assets to the list of deferred assets.
60- deferredAssets.addAll (deferredComponent.assets ?? []);
61- });
62-
63- // Merge the deferred assets with the main assets.
64- return [...config.pubspec.flutter.assets, ...deferredAssets];
57+ final deferredComponents = config.pubspec.flutter.deferredComponents ?? [];
58+ return deferredComponents.fold <List <Object >>(
59+ config.pubspec.flutter.assets,
60+ (list, deferredComponent) => list + (deferredComponent.assets ?? []),
61+ );
6562}
6663
6764Future <String > generateAssets (
You can’t perform that action at this time.
0 commit comments