I don’t understand why the image is not loading wi...
# compose
m
I don’t understand why the image is not loading with coil. Can some1 spot the mistake? It’s a valid url
Copy code
if (imageUrl == null) {
    placeHolderComposable()
} else {
    val load: ImagePainter = rememberImagePainter(
        data = imageUrl
    )

    when (val state = load.state) {
        ImagePainter.State.Empty,
        is ImagePainter.State.Loading,
        is ImagePainter.State.Error -> {
            placeHolderComposable()
        }
        is ImagePainter.State.Success -> {
            Image(
                modifier = Modifier
                    .size(imageSize)
                    .then(imagePaddingModifier),
                painter = state.painter,
                contentDescription = imageContentDescription
            )
        }
    }
}
The state never advances from empty. why
a
I don't think you need the 'is' for every condition. Try removing it
m
nah that’s not it. for some reason, this does not work
my guess is that the request won’t start unless it’s attached to something. Cannot do it like this