@Composable public 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 { return rememberAsyncImagePainter( model = ImageRequest.Builder(LocalContext.current) .data(data).build(), imageLoader = LocalStreamImageLoader.current, placeholder = placeholderPainter, error = errorPainter, fallback = fallbackPainter, contentScale = contentScale, onSuccess = onSuccess, onError = onError, onLoading = onLoading, filterQuality = filterQuality ) }
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.