BloomPicture constructor

BloomPicture({
  1. required List<PictureSource> sources,
  2. required String fallbackSrc,
  3. String? alt,
  4. bool decorative = false,
  5. int? width,
  6. int? height,
  7. String? aspectRatio,
  8. List<int>? fallbackWidths,
  9. String? sizes,
  10. ImageUrlBuilder? urlBuilder,
  11. ImageLoading loading = ImageLoading.lazy,
  12. ImageDecoding decoding = ImageDecoding.async,
  13. FetchPriority? fetchPriority,
  14. bool priority = false,
  15. String? placeholder,
  16. String? fallbackOnErrorSrc,
  17. ImageFit? fit,
  18. String? className,
  19. String? style,
  20. Map<String, String>? attrs,
  21. BloomEventHandler? onClick,
  22. BloomEventHandler? onLoad,
  23. BloomEventHandler? onError,
  24. Ref<Object>? ref,
})

Creates a <picture> container enclosing sources and an inner fallback BloomImage.

Implementation

BloomPicture({
  required List<PictureSource> sources,
  required String fallbackSrc,
  String? alt,
  bool decorative = false,
  int? width,
  int? height,
  String? aspectRatio,
  List<int>? fallbackWidths,
  String? sizes,
  ImageUrlBuilder? urlBuilder,
  ImageLoading loading = ImageLoading.lazy,
  ImageDecoding decoding = ImageDecoding.async,
  FetchPriority? fetchPriority,
  bool priority = false,
  String? placeholder,
  String? fallbackOnErrorSrc,
  ImageFit? fit,
  super.className,
  super.style,
  super.attrs,
  BloomEventHandler? onClick,
  BloomEventHandler? onLoad,
  BloomEventHandler? onError,
  Ref<Object>? ref,
}) : super(
        'picture',
        children: [
          ...sources.map((s) => s.toNode()),
          BloomImage(
            src: fallbackSrc,
            alt: alt,
            decorative: decorative,
            width: width,
            height: height,
            aspectRatio: aspectRatio,
            widths: fallbackWidths,
            sizes: sizes,
            urlBuilder: urlBuilder,
            loading: loading,
            decoding: decoding,
            fetchPriority: fetchPriority,
            priority: priority,
            placeholder: placeholder,
            fallbackSrc: fallbackOnErrorSrc,
            fit: fit,
            onClick: onClick,
            onLoad: onLoad,
            onError: onError,
            ref: ref,
          ),
        ],
      );