PrefetchMode enum

Speculative prefetching strategies for Link navigation targets.

Configures how aggressively Link elements preload route data and lazy components before the user clicks the link.

Speculative prefetch requests are deduplicated per clean path for the duration of the session, and any network or evaluation errors during prefetch are caught and swallowed silently without affecting application execution.

// Prefetch when the link enters the viewport
Link(href: '/dashboard', prefetch: PrefetchMode.visible, text: 'Dashboard');

// Prefetch on pointer hover
Link(href: '/settings', prefetch: PrefetchMode.hover, text: 'Settings');

// Disable prefetching
Link(href: '/logout', prefetch: PrefetchMode.off, text: 'Log Out');
Inheritance
Available extensions

Values

off → const PrefetchMode

Never prefetch route assets or data ahead of a click.

hover → const PrefetchMode

Triggers route prefetching when the user hovers over or points at the link (pointerenter / mouseenter).

visible → const PrefetchMode

Triggers route prefetching when the link scrolls into the viewport via IntersectionObserver.

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

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

Constants

values → const List<PrefetchMode>
A constant List of the values in this enum, in order of their declaration.