remember Async Image Painter
Return an AsyncImagePainter that executes an ImageRequest asynchronously and renders the result.
This is a lower-level API than AsyncImage and may not work as expected in all situations.It's highly recommended to use AsyncImage unless you need a reference to a Painter.
AsyncImagePainter will not finish loading if AsyncImagePainter.onDraw is not called. This can occur if a composable has an unbounded (i.e. Constraints.Infinity) width/height constraint. For example, to use AsyncImagePainter with LazyRow or LazyColumn, you must set a bounded width or height respectively.
AsyncImagePainter.state does not transition to State.Success synchronously during the composition phase. Use SubcomposeAsyncImage if you need this.
Parameters
Either an ImageRequest or the ImageRequest.data value.
A Painter that is displayed while the image is loading.
A Painter that is displayed when the image request is unsuccessful.
A Painter that is displayed when the request's ImageRequest.data is null.
Called when the image request begins loading.
Called when the image request completes successfully.
Called when the image request completes unsuccessfully.
Used to determine the aspect ratio scaling to be used if the canvas bounds are a different size from the intrinsic size of the image loaded by model. This should be set to the same value that's passed to Image.
Sampling algorithm applied to a bitmap when it is scaled and drawn into the destination.
Return an AsyncImagePainter that executes an ImageRequest asynchronously and renders the result.
This is a lower-level API than AsyncImage and may not work as expected in all situations.It's highly recommended to use AsyncImage unless you need a reference to a Painter.
AsyncImagePainter will not finish loading if AsyncImagePainter.onDraw is not called. This can occur if a composable has an unbounded (i.e. Constraints.Infinity) width/height constraint. For example, to use AsyncImagePainter with LazyRow or LazyColumn, you must set a bounded width or height respectively.
AsyncImagePainter.state does not transition to State.Success synchronously during the composition phase. Use SubcomposeAsyncImage if you need this.
Parameters
Either an ImageRequest or the ImageRequest.data value.
A callback to transform a new State before it's applied to the AsyncImagePainter. Typically this is used to overwrite the state's Painter.
Called when the state of this painter changes.
Used to determine the aspect ratio scaling to be used if the canvas bounds are a different size from the intrinsic size of the image loaded by model. This should be set to the same value that's passed to Image.
Sampling algorithm applied to a bitmap when it is scaled and drawn into the destination.