MediaAsset class Null safety

Implemented types

Constructors

MediaAsset([void updates(MediaAssetBuilder)])
factory

Properties

formats BuiltMap<MediaAssetFormatVariant, MediaVariant>
read-only
hashCode int
The hash code for this object.
read-onlyinherited
id String
read-only
location MediaAssetLocation
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
url String
read-only

Methods

isImage() bool
Returns true if this asset is an image, false otherwise. If the asset does not have any mime-typed format variants, it will assume that it is an image, even if it isn't.
nearestVariantUrl({required MediaAssetFormatVariant variant}) String
Looks up the specified format variant in the asset and returns the corresponding URL. If the URL is not found, it will return the next largest variant. If none are found, will return the asset's main URL. This method is designed to work with image assets that reside in Strapi's media library.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
rebuild(dynamic updates(MediaAssetBuilder)) MediaAsset
Rebuilds the instance.
inherited
toBuilder() MediaAssetBuilder
Converts the instance to a builder B.
inherited
toString() String
A string representation of this object.
inherited

Operators

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