HostActionRequest class abstract

Standard request envelope sent from the SDK to a host bridge action handler.

The action field is the stable wire name, while payload stays JSON-shaped so the SDK and host can validate and deserialize it into the appropriate typed action payload model.

Available extensions
Annotations
  • @freezed

Constructors

HostActionRequest({String? requestId, @JsonKey.new(name: 'action') required String actionName, @Default.new(<String, dynamic>{}) Map<String, dynamic> payload})
const
factory
HostActionRequest.callSecureApi({String? requestId, required CallSecureApiActionPayload payload})
factory
HostActionRequest.fromJson(Map<String, dynamic> json)
factory
HostActionRequest.openNativeScreen({String? requestId, required OpenNativeScreenActionPayload payload})
factory
HostActionRequest.trackEvent({String? requestId, required TrackEventActionPayload payload})
factory

Properties

actionName String
no setterinherited
copyWith → $HostActionRequestCopyWith<HostActionRequest>
Create a copy of HostActionRequest with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
payload Map<String, dynamic>
no setterinherited
requestId String?
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Available on HostActionRequest, provided by the HostActionRequestPatterns extension

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

Available on HostActionRequest, provided by the HostActionRequestPatterns extension

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

Available on HostActionRequest, provided by the HostActionRequestPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String? requestId, String actionName, Map<String, dynamic> payload)?, {required TResult orElse()}) → TResult

Available on HostActionRequest, provided by the HostActionRequestPatterns 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 HostActionRequest to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String? requestId, String actionName, Map<String, dynamic> payload)) → TResult

Available on HostActionRequest, provided by the HostActionRequestPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String? requestId, String actionName, Map<String, dynamic> payload)?) → TResult?

Available on HostActionRequest, provided by the HostActionRequestPatterns extension

A variant of when that fallback to returning null

Operators

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