ImageUrl class
CDN transform wrapper around ImageReference.
Adds url() method with width/height/format/quality params that delegates
to a pluggable TransformUrlBuilder. Without a transform, returns the
raw URL from the underlying ImageReference.
Both ImageUrl and ImageReference serialize to the same wire format. You can switch between them without data migration.
Constructors
- ImageUrl({required ImageReference imageRef, TransformUrlBuilder? transformUrl})
-
const
-
ImageUrl.fromMap(Map<
String, dynamic> map) -
Decodes a stored or resolved imageReference JSON node into an ImageUrl.
factory
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> -
Outputs stored format — identical to
imageRef.toMap(). -
toString(
) → String -
A string representation of this object.
inherited
-
url(
{int? width, int? height, FitMode? fit, String? format, int? quality}) → String? - Returns a (optionally transformed) URL for this image.
-
withTransform(
TransformUrlBuilder builder) → ImageUrl -
Returns a new ImageUrl with the given
builderapplied to url.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited