hehua2008 2 weeks ago committed by GitHub
parent
commit
a5653f4272
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      tutorials/Image_And_Icons_Manipulations/README.md

4
tutorials/Image_And_Icons_Manipulations/README.md

@ -68,7 +68,7 @@ fun main() = singleWindowApplication {
Column {
AsyncImage(
load = { loadImageBitmap(File("sample.png")) },
painterFor = { remember { BitmapPainter(it) } },
painterFor = { remember(it) { BitmapPainter(it) } },
contentDescription = "Sample",
modifier = Modifier.width(200.dp)
)
@ -97,7 +97,7 @@ fun <T> AsyncImage(
modifier: Modifier = Modifier,
contentScale: ContentScale = ContentScale.Fit,
) {
val image: T? by produceState<T?>(null) {
val image: T? by produceState<T?>(null, load) {
value = withContext(Dispatchers.IO) {
try {
load()

Loading…
Cancel
Save