ImagePainter constructor

const ImagePainter({
  1. Key? key,
  2. required Uint8List imageBytes,
  3. required Widget placeholder,
  4. Image? precachedImage,
  5. void onImageLoaded(
    1. Image
    )?,
})

Create an ImagePainter that loads an image from a byte array. The onImageLoaded callback is called when the image is loaded. The placeholder widget is displayed while the image is loading. Optionally a precachedImage can be provided to display the image directly without altering the calling widget between caching.

Implementation

const ImagePainter({
  super.key,
  required this.imageBytes,
  required this.placeholder,
  this.precachedImage,
  this.onImageLoaded,
});