val bitmap = ImageBitmap.imageResource(id = R.drawable.pikcha)
var image by remember { mutableStateOf(bitmap) }
Image(
bitmap = image,
contentDescription = null
)
Button(
onClick = {
lifecycleScope.launch(Dispatchers.IO) {
val user = api.auth(AuthRequest(username, password))
val request = ImageRequest.Builder(context)
.data(user.image)
.build()
val drawable = context.imageLoader.execute(request).drawable
image = (drawable as BitmapDrawable).bitmap.asImageBitmap()
}
}
)
Вот так получилось.
Как через rememberAsyncImagePainter() делать так и не понял