SanityImage class
A model for a Sanity Image.
Contains the SanityAsset, which is the minimum information needed to show an image.
Also contains the Crop
and Hotspot
which signal how to format the image.
- Inheritance
-
- Object
- SanityImageSource
- SanityImage
Constructors
- SanityImage.new({required String ref, Crop? c, Hotspot? h, SanityAsset? asset})
-
const
Properties
- asset → SanityAsset?
-
final
- c → Crop?
-
final
- crop → Crop
-
gets the crop of an image.
no setter
- h → Hotspot?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hotspot → Hotspot
-
gets the hotspot of an image.
no setter
- id → String
-
finalinherited
- lqip → String?
-
gets the low quality image preview of an image.
no setter
- palette → SanityPalette?
-
gets the palette of an image.
no setter
- ref → dynamic
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseAssetId(
) → ReferenceData -
parses the
id
of a reference. from a String id and returnsReferenceData
.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Map< String, dynamic> json) → SanityImage -
Parses
json
into a SanityImage. accepts either a Sanity Image which would look like this: query would look like:*[_type=='meditation']{image}