MessageAction class
An optional action attached to a bot reply — rendered as a tappable button under the message bubble. Supports three ways to handle the tap so the SDK user (the app embedding this widget) can pick whichever fits — set any combination, they all fire if set:
- route: a named route (e.g.
/pricing) pushed viaNavigator.pushNamedon the host app's ownNavigator. - url: an external URL (e.g.
https://shopmart.com/contact) opened viaurl_launcher. - actionId: an arbitrary string handed back via the
onActioncallback on AarohChatWidget /pushAarohChat, for any custom logic.
Tap order when multiple are set: onAction callback first, then
route (in-app navigation), then url (external link) as a fallback.
Constructors
- MessageAction({required String label, String? route, String? url, String? actionId})
-
const
-
MessageAction.fromJson(Map<
String, dynamic> json) -
factory
Properties
- actionId → String?
-
Opaque id passed to the host app's
onActioncallback. Optional.final - hashCode → int
-
The hash code for this object.
no setterinherited
- label → String
-
Button text, e.g. 'View Pricing', 'Contact Us'.
final
- route → String?
-
Named in-app route to push, e.g. '/pricing'. Optional.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url → String?
-
External URL to open, e.g. 'https://example.com/contact'. Optional.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited