RichAction class sealed
Base sealed class for all action types.
- Available extensions
- Annotations
-
- @Freezed.new(unionKey: 'type')
Constructors
-
RichAction.callback({@JsonKey.new(name: 'callback_id') required String callbackId, required String label, Map<
String, dynamic> ? payload, @Default.new('secondary') String style}) -
Action to trigger a custom callback
constfactory
- RichAction.changeLanguage({required String locale})
-
Silent action: switch the chat UI language live to
locale. Emitted by the backend'schange_languageplatform tool and carried onRichContentResponse.actions(never rendered as a button). The action handler dispatches it straight toChatViewModel.setLocale.constfactory -
RichAction.fromJson(Map<
String, dynamic> json) -
factory
- RichAction.openUrl({required String url, required String label, @JsonKey.new(name: 'open_in_app') @Default.new(false) bool openInApp, @Default.new('primary') String style})
-
Action to open a URL in browser or in-app
constfactory
- RichAction.requestInput({@JsonKey.new(name: 'input_type') required String inputType, required String label, @Default.new('both') String source, @Default.new('primary') String style})
-
Action that asks the user to share a specific kind of input
(photo, audio, …) to continue. The SDK renders a tappable chip
below the message and pulses the input-bar attach button — so
the user has both a one-tap affordance and a visual nudge to
the existing upload button.
constfactory
- RichAction.sendMessage({required String message, required String label, @JsonKey.new(name: 'show_in_chat') @Default.new(true) bool showInChat, @Default.new('secondary') String style})
-
Action to send a message in the chat
constfactory
Properties
- 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?> ({required TResult openUrl(OpenUrlAction value), required TResult sendMessage(SendMessageAction value), required TResult callback(CallbackAction value), required TResult requestInput(RequestInputAction value), required TResult changeLanguage(ChangeLanguageAction value)}) → TResult -
Available on RichAction, provided by the RichActionPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> ({TResult? openUrl(OpenUrlAction value)?, TResult? sendMessage(SendMessageAction value)?, TResult? callback(CallbackAction value)?, TResult? requestInput(RequestInputAction value)?, TResult? changeLanguage(ChangeLanguageAction value)?}) → TResult? -
Available on RichAction, provided by the RichActionPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> ({TResult openUrl(OpenUrlAction value)?, TResult sendMessage(SendMessageAction value)?, TResult callback(CallbackAction value)?, TResult requestInput(RequestInputAction value)?, TResult changeLanguage(ChangeLanguageAction value)?, required TResult orElse()}) → TResult -
Available on RichAction, provided by the RichActionPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> ({TResult openUrl(String url, String label, bool openInApp, String style)?, TResult sendMessage(String url, String label, bool openInApp, String style)?, TResult callback(String callbackId, String label, Map< String, dynamic> ? payload, String style)?, TResult requestInput(String inputType, String label, String source, String style)?, TResult changeLanguage(String locale)?, required TResult orElse()}) → TResult -
Available on RichAction, provided by the RichActionPatterns 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 RichAction to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> ({required TResult openUrl(String url, String label, bool openInApp, String style), required TResult sendMessage(String url, String label, bool openInApp, String style), required TResult callback(String callbackId, String label, Map< String, dynamic> ? payload, String style), required TResult requestInput(String inputType, String label, String source, String style), required TResult changeLanguage(String locale)}) → TResult -
Available on RichAction, provided by the RichActionPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> ({TResult? openUrl(String url, String label, bool openInApp, String style)?, TResult? sendMessage(String url, String label, bool openInApp, String style)?, TResult? callback(String callbackId, String label, Map< String, dynamic> ? payload, String style)?, TResult? requestInput(String inputType, String label, String source, String style)?, TResult? changeLanguage(String locale)?}) → TResult? -
Available on RichAction, provided by the RichActionPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited