AssetModel class

Defines an asset that is utilized throughout node data as an id and looked up for information about the asset based on that id.

Available extensions
Annotations
  • @JsonSerializable.new()

Constructors

AssetModel({required String id, required String name, required String url, String blurHash = '', required double sourceWidth, required double sourceHeight, required DateTime createdAt})
Creates a new asset model.
AssetModel.fromJson(Map<String, dynamic> json)
Creates a new asset model from a json map.
factory

Properties

aspectRatio → double
no setter
blurHash → String
final
createdAt → DateTime
Date and time when the asset was created.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
The id of the asset.
final
imageExtension → String

Available on AssetModel, provided by the AssetModelExt extension

no setter
isGifImage → bool

Available on AssetModel, provided by the AssetModelExt extension

no setter
isStaticImage → bool

Available on AssetModel, provided by the AssetModelExt extension

no setter
isSvgImage → bool

Available on AssetModel, provided by the AssetModelExt extension

no setter
name → String
The user-facing label of the asset.
final
props → List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sourceHeight → double
The source height of the asset.
final
sourceWidth → double
The source width of the asset.
final
stringify → bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
url → String
The url of the asset.
final

Methods

copyWith({String? id, String? name, String? url, String? blurHash, double? sourceWidth, double? sourceHeight, DateTime? createdAt}) → AssetModel
Creates a copy of this asset model but with the given fields replaced with the new values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this asset model to a json map.
toString() → String
A string representation of this object.
inherited

Operators

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