BloomPicture constructor
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,
- String? className,
- String? style,
- Map<
String, String> ? attrs, - BloomEventHandler? onClick,
- BloomEventHandler? onLoad,
- BloomEventHandler? onError,
- 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,
),
],
);