rememberStreamImagePainter

fun rememberStreamImagePainter(data: Any?, placeholderPainter: Painter? = null, errorPainter: Painter? = null, fallbackPainter: Painter? = errorPainter, onLoading: (AsyncImagePainter.State.Loading) -> Unit? = null, onSuccess: (AsyncImagePainter.State.Success) -> Unit? = null, onError: (AsyncImagePainter.State.Error) -> Unit? = null, contentScale: ContentScale = ContentScale.Fit, filterQuality: FilterQuality = DrawScope.DefaultFilterQuality): AsyncImagePainter

Wrapper around the coil.compose.rememberAsyncImagePainter that plugs in our LocalStreamImageLoader singleton that can be used to customize all image loading requests, like adding headers, interceptors and similar.

Return

The AsyncImagePainter that remembers the request and the image that we want to show.

Parameters

data

The data to load as a painter.

placeholderPainter

The painter used as a placeholder, while loading.

errorPainter

The painter used when the request fails.

fallbackPainter

The painter used as a fallback, in case the data is null.

onLoading

Handler when the loading starts.

onSuccess

Handler when the request is successful.

onError

Handler when the request fails.

contentScale

The scaling model to use for the image.

filterQuality

The quality algorithm used when scaling the image.


fun rememberStreamImagePainter(model: ImageRequest, placeholderPainter: Painter? = null, errorPainter: Painter? = null, fallbackPainter: Painter? = errorPainter, onLoading: (AsyncImagePainter.State.Loading) -> Unit? = null, onSuccess: (AsyncImagePainter.State.Success) -> Unit? = null, onError: (AsyncImagePainter.State.Error) -> Unit? = null, contentScale: ContentScale = ContentScale.Fit, filterQuality: FilterQuality = DrawScope.DefaultFilterQuality): AsyncImagePainter

Wrapper around the coil.compose.rememberAsyncImagePainter that plugs in our LocalStreamImageLoader singleton that can be used to customize all image loading requests, like adding headers, interceptors and similar.

Return

The AsyncImagePainter that remembers the request and the image that we want to show.

Parameters

model

The ImageRequest used to load the given image.

placeholderPainter

The painter used as a placeholder, while loading.

errorPainter

The painter used when the request fails.

fallbackPainter

The painter used as a fallback, in case the data is null.

onLoading

Handler when the loading starts.

onSuccess

Handler when the request is successful.

onError

Handler when the request fails.

contentScale

The scaling model to use for the image.

filterQuality

The quality algorithm used when scaling the image.