BloomImage class
An optimized, responsive <img> element descriptor.
Subclasses ElNode directly with tag 'img', preserving exhaustive pattern-matching
compatibility across SSR (renderToHtml) and browser mounting (mount).
Accepts layout dimensions, placeholder backgrounds, responsive width variants, and priority hints.
BloomImage(
src: '/assets/banner.webp',
alt: 'Summer Sale Promotion',
width: 1200,
height: 400,
priority: true, // Hero image optimization
);
See also:
- bloomImage, convenience factory function.
- BloomPicture, container for art-directed multi-source picture elements.
Constructors
-
BloomImage({required String src, String? alt, bool decorative = false, int? width, int? height, String? aspectRatio, List<
int> ? widths, String? sizes, ImageUrlBuilder? urlBuilder, ImageLoading loading = ImageLoading.lazy, ImageDecoding decoding = ImageDecoding.async, FetchPriority? fetchPriority, bool priority = false, String? placeholder, String? fallbackSrc, ImageFit? fit, String? className, String? style, Map<String, String> ? attrs, BloomEventHandler? onClick, BloomEventHandler? onLoad, BloomEventHandler? onError, Ref<Object> ? ref}) - Creates a responsive image descriptor with layout stability, lazy loading, accessibility checks, and placeholder styling.
-
BloomImage.raw({String? className, String? style, Map<
String, String> ? attrs, Map<String, BloomEventHandler> ? on}) -
Const constructor for BloomImage with pre-computed attributes and event listeners.
const
Properties
-
attrs
→ Map<
String, String> ? -
Arbitrary HTML attributes (id, href, placeholder, etc.).
finalinherited
-
children
→ List<
BloomNode> -
Child descriptors nested within this element.
finalinherited
- className → String?
-
CSS class attribute applied to the element.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
on
→ Map<
String, BloomEventHandler> ? -
Event handlers keyed by DOM event name (click, input, change...).
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → String?
-
Inline style — raw CSS string (e.g. "color: red; display: flex;").
finalinherited
- tag → String
-
Lowercase tag name, e.g. "div", "button", "custom-tag".
finalinherited
- text → String?
-
Optional single text child sugar — equivalent to
children: [Text(text)]when no explicit children are given.finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited