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

A switch-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 of map that fallback to returning null.
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 of map that fallback to returning orElse.
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 of when that fallback to an orElse callback.
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

A switch-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 of when that fallback to returning null