From b2e13dabf37303de583ac630bd86779f1c2bd09d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 11 Aug 2023 17:55:52 +0200 Subject: [PATCH] fix: asset lookup for flavors (#94) --- packages/ubuntu_utils/lib/src/proxy_asset_bundle.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/ubuntu_utils/lib/src/proxy_asset_bundle.dart b/packages/ubuntu_utils/lib/src/proxy_asset_bundle.dart index b9c479c83..b7fe48fe8 100644 --- a/packages/ubuntu_utils/lib/src/proxy_asset_bundle.dart +++ b/packages/ubuntu_utils/lib/src/proxy_asset_bundle.dart @@ -29,11 +29,10 @@ class ProxyAssetBundle extends AssetBundle { } String _findAsset(String assetName, {required String package}) { - if (p.isWithin('packages/$package', assetName)) { - return _findAsset( - p.relative(assetName, from: 'packages/$package'), - package: package, - ); + if (p.isWithin('packages/', assetName)) { + final candidate = + _findAsset(p.split(assetName).skip(2).join('/'), package: package); + if (File(candidate).existsSync()) return candidate; } // /data/flutter_assets/