ImageReference class
A reference to an image asset in the content management system.
This class represents an image reference that can be used in content models. It supports both direct asset references and Sanity-specific image assets.
Example:
final imageRef = ImageReference(
type: 'image',
asset: ObjectReference(type: 'reference', ref: 'image-abc123'),
);
- Annotations
-
- @JsonSerializable()
Constructors
- ImageReference.new({required String type, required ObjectReference? asset, String? sanityAsset})
-
ImageReference.fromJson(Map<
String, dynamic> json) -
factory
Properties
- asset → ObjectReference?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sanityAsset → String?
-
final
- type → String
-
final
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