ImageLoading enum
Loading strategies determining when the browser initiates image network fetching.
Controls the HTML loading attribute on <img> elements. By default, bloomImage
and BloomImage specify ImageLoading.lazy to minimize bandwidth consumption and
avoid competing with critical resources during initial page load.
For above-the-fold hero images or critical visual elements, specify ImageLoading.eager
(or set priority: true on bloomImage) to prevent delayed Largest Contentful Paint (LCP).
bloomImage(
src: '/assets/banner.webp',
alt: 'Homepage Banner',
loading: ImageLoading.eager,
);
See also:
- bloomImage, the primary responsive image helper.
- BloomImage, the image element descriptor node.
- FetchPriority, for resource scheduling priority hints.
Values
- lazy → const ImageLoading
-
Defers loading the image until it reaches a calculated distance from the viewport.
Recommended for all below-the-fold images to conserve network bandwidth and speed up the initial page render.
const ImageLoading('lazy') - eager → const ImageLoading
-
Loads the image immediately upon DOM parsing, regardless of viewport position.
Recommended for above-the-fold hero images, key product shots, and critical UI elements contributing directly to Largest Contentful Paint (LCP).
const ImageLoading('eager')
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → String
-
The raw HTML attribute string value (
"lazy"or"eager").final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
ImageLoading> - A constant List of the values in this enum, in order of their declaration.