showImage

fun showImage(url: String, imageDescription: String = "", onBadUrl: @Composable () -> Unit? = null, imageModifier: Modifier = Modifier): Boolean

Displays an image asynchronously using Coil's AsyncImage.

Checks the URL before loading and displays fallback content when the URL is invalid.

Return

true if the URL passes validation, false otherwise.

Parameters

url

The URL of the image to load.

imageDescription

Description for accessibility.

onBadUrl

Optional composable content for invalid URLs.

imageModifier

Customizes the image's appearance.