RichContentResponse class abstract

Response containing rich content components from the backend.

Available extensions
Annotations
  • @freezed

Constructors

RichContentResponse({required List<RichComponent> components, @JsonKey.new(name: 'fallback_text') String? fallbackText, List<RichAction>? actions})
const
factory
RichContentResponse.fromJson(Map<String, dynamic> json)
factory

Properties

actions List<RichAction>?
Silent, non-interactive actions the SDK auto-dispatches on render — no button is drawn. Used for things like ChangeLanguageAction where the backend's tool call should switch the chat language without any user tap. Interactive actions still live inside their components (card / image / button_group).
no setterinherited
components List<RichComponent>
List of components to render
no setterinherited
copyWith → $RichContentResponseCopyWith<RichContentResponse>
Create a copy of RichContentResponse with the given fields replaced by the non-null parameter values.
no setterinherited
fallbackText String?
Fallback text for accessibility or error states
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_RichContentResponse value)) → TResult

Available on RichContentResponse, provided by the RichContentResponsePatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_RichContentResponse value)?) → TResult?

Available on RichContentResponse, provided by the RichContentResponsePatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_RichContentResponse value)?, {required TResult orElse()}) → TResult

Available on RichContentResponse, provided by the RichContentResponsePatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(List<RichComponent> components, String? fallbackText, List<RichAction>? actions)?, {required TResult orElse()}) → TResult

Available on RichContentResponse, provided by the RichContentResponsePatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this RichContentResponse to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(List<RichComponent> components, String? fallbackText, List<RichAction>? actions)) → TResult

Available on RichContentResponse, provided by the RichContentResponsePatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(List<RichComponent> components, String? fallbackText, List<RichAction>? actions)?) → TResult?

Available on RichContentResponse, provided by the RichContentResponsePatterns extension

A variant of when that fallback to returning null

Operators

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