Fix flavor-conditional asset bundling for path dependencies (#156687)

Fixes https://github.com/flutter/flutter/issues/155755

When building the asset bundle during, the `--flavor` option isn't considered when searching for assets from dependencies. This PR fixes that.

It's possible that when initially implementing this feature, I thought that flavor-conditional assets didn't make sense for packages. While I still think that way regarding pub packages, using this feature makes a lot more sense for monorepo projects.

<details>

<summary> Pre-launch checklist </summary> 

</details>
This commit is contained in:
Andrew Kolos
2024-10-15 10:39:01 -07:00
committed by GitHub
parent 915985ad52
commit 2dad95b21c
2 changed files with 94 additions and 8 deletions

View File

@@ -380,6 +380,7 @@ class ManifestAssetBundle implements AssetBundle {
targetPlatform,
packageName: package.name,
attributedPackage: package,
flavor: flavor,
);
if (packageAssets == null) {
@@ -873,7 +874,7 @@ class ManifestAssetBundle implements AssetBundle {
TargetPlatform? targetPlatform, {
String? packageName,
Package? attributedPackage,
String? flavor,
required String? flavor,
}) {
final Map<_Asset, List<_Asset>> result = <_Asset, List<_Asset>>{};