RichActionPatterns extension
Adds pattern-matching-related methods to RichAction.
- on
Methods
-
map<
TResult extends Object?> ({required TResult openUrl(OpenUrlAction value), required TResult sendMessage(SendMessageAction value), required TResult callback(CallbackAction 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? -
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)?, 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 message, String label, bool showInChat, String style)?, TResult callback(String callbackId, String label, Map< String, dynamic> ? payload, String style)?, required TResult orElse()}) → TResult -
Available on RichAction, provided by the RichActionPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
when<
TResult extends Object?> ({required TResult openUrl(String url, String label, bool openInApp, String style), required TResult sendMessage(String message, String label, bool showInChat, String style), required TResult callback(String callbackId, String label, Map< String, dynamic> ? payload, String style)}) → 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 message, String label, bool showInChat, String style)?, TResult? callback(String callbackId, String label, Map< String, dynamic> ? payload, String style)?}) → TResult? -
Available on RichAction, provided by the RichActionPatterns extension
A variant ofwhenthat fallback to returningnull