MNetworkImage class

An image loaded from the network and cached on disk.

The widget process downloads the URL on its own — no app launch — and stores it in the shared container, keyed by URL. Later renders read the cached file, so the image survives redraws and appears offline.

url accepts a literal or an MBind, so a URL fetched by a refresh: source (e.g. an article thumbnail) can drive it.

Nothing is drawn until the first download completes; give the widget a placeholder colour if an empty frame would look broken.

Inheritance

Constructors

MNetworkImage(Object url, {MBoxFit fit = MBoxFit.cover, MColor? placeholder, double? radius, bool circle = false, MAccentedRendering accentedMode = MAccentedRendering.fullColor})
const

Properties

accentedMode → MAccentedRendering
How this image renders when widgets are tinted (iOS 18+).
final
circle → bool
Clips to a circle — the usual way to get an avatar.
final
fit → MBoxFit
final
hashCode → int
The hash code for this object.
no setterinherited
placeholder → MColor?
Fill shown before the first successful download.
final
radius → double?
Corner radius in logical pixels. Ignored when circle is true.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
url → Object
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited