RichImage class abstract
Image data for cards and image components.
- Available extensions
- Annotations
-
- @freezed
Constructors
- RichImage({required String url, String? alt, @JsonKey.new(name: 'aspect_ratio') @Default.new('16:9') String aspectRatio, @Default.new(false) bool loading, @JsonKey.new(name: 'on_tap_callback') OnTapCallback? onTapCallback})
-
constfactory
-
RichImage.fromJson(Map<
String, dynamic> json) -
factory
Properties
- alt → String?
-
no setterinherited
- aspectRatio → String
-
no setterinherited
-
copyWith
→ $RichImageCopyWith<
RichImage> -
Create a copy of RichImage
with the given fields replaced by the non-null parameter values.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- loading → bool
-
When true, the renderer paints a shimmer placeholder over the image
area instead of the actual
url. Use this when the backend has triggered an async generation (e.g. a nail design render) and wants the chat surface to feel alive while the task is still pending. The accompanying card typically carries acallbackaction whosepayload.task_idthe host polls; when the task resolves, the host updates the message in place withloading: falseand the real URL.no setterinherited - onTapCallback → OnTapCallback?
-
Fires a host callback when the image is tapped, instead of the
SDK's default zoomable full-screen preview. Use this when the
host wants per-image-kind behaviour — e.g. opening a viewer
with share / report / delete actions for a generated design, or
pushing a dedicated result page for a try-on. Shimmer
placeholders (loading=true) ignore this and stay non-tappable.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url → String
-
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_RichImage value)) → TResult -
Available on RichImage, provided by the RichImagePatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_RichImage value)?) → TResult? -
Available on RichImage, provided by the RichImagePatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_RichImage value)?, {required TResult orElse()}) → TResult -
Available on RichImage, provided by the RichImagePatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(String url, String? alt, String aspectRatio, bool loading, OnTapCallback? onTapCallback)?, {required TResult orElse()}) → TResult -
Available on RichImage, provided by the RichImagePatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this RichImage to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(String url, String? alt, String aspectRatio, bool loading, OnTapCallback? onTapCallback)) → TResult -
Available on RichImage, provided by the RichImagePatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(String url, String? alt, String aspectRatio, bool loading, OnTapCallback? onTapCallback)?) → TResult? -
Available on RichImage, provided by the RichImagePatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited