fix(android): resolve local asset image resource loading using asyncimage and bundle url

This commit is contained in:
Daniel Arantes Loverde
2026-05-27 15:01:49 -03:00
parent c14bd7a928
commit 215d208f4f
24 changed files with 103 additions and 36 deletions

View File

@@ -96,12 +96,18 @@ struct FeaturedStoreCard: View {
private var storeIconPlaceholder: some View {
ZStack {
#if os(Android)
Image("placeholder-product", bundle: .module)
.resizable()
.scaledToFill()
.opacity(0.7)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.clipped()
AsyncImage(url: Bundle.module.url(forResource: "placeholder-product", withExtension: "png")) { phase in
if let image = phase.image {
image
.resizable()
} else {
Color.clear
}
}
.scaledToFill()
.opacity(0.7)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.clipped()
#else
Image("placeholder-product")
.resizable()