Open faridsavarudin opened 2 months ago
using ktor version 3.0.0-beta-2, using kamel version 0.9.5
@Composable fun ImageLoader(url: String, desc: String, modifier: Modifier, contentScale: ContentScale) { val imageResources = LocalImageResource.current
when (val resource = asyncPainterResource(url)) { is Resource.Loading -> { LoadingScreen() } is Resource.Success -> { val painter: Painter = resource.value Image(painter, contentDescription = desc, modifier = modifier, contentScale = contentScale) } is Resource.Failure -> { val fallbackPainter = imageResources.Company() Image(fallbackPainter, contentDescription = desc, modifier = modifier, contentScale = ContentScale.FillHeight) } }
}
I always go to Resource.Failure, and got this message error
No static method onDownload(Lio/ktor/client/request/HttpRequestBuilder;Lkotlin/jvm/functions/Function3;)V
You most likely will have to use the latest beta version if you want to use the beta version of ktor
using ktor version 3.0.0-beta-2, using kamel version 0.9.5
@Composable fun ImageLoader(url: String, desc: String, modifier: Modifier, contentScale: ContentScale) { val imageResources = LocalImageResource.current
}
I always go to Resource.Failure, and got this message error
No static method onDownload(Lio/ktor/client/request/HttpRequestBuilder;Lkotlin/jvm/functions/Function3;)V