ImageView constructor

const ImageView({
  1. Key? key,
  2. required Future<String> url,
  3. Duration? fadeOutDuration = const Duration(milliseconds: 250),
  4. ImageStyle style = const ImageStyle(),
  5. String? thumbHash,
  6. String? blurHash,
  7. String? cacheKey,
})

Creates an ImageView widget.

The url parameter is required and should be a Future that resolves to the image URL. Either thumbHash or blurHash can be provided to generate a placeholder.

Example:

ImageView(
  url: Future.value("https://example.com/image.jpg"),
  blurHash: "L6PZfSi_.AyE_3t7t7R**0o#DgR4",
  style: ImageStyle(
    fit: BoxFit.cover,
    width: 300,
    height: 200,
  ),
)

Implementation

const ImageView(
    {super.key,
    required this.url,
    this.fadeOutDuration = const Duration(milliseconds: 250),
    this.style = const ImageStyle(),
    this.thumbHash,
    this.blurHash,
    this.cacheKey});