PingPongPlatformNotification class
A platform notification for one request and one terminal response.
- Inheritance
-
- Object
- PlatformNotification
- PingPongPlatformNotification
Constructors
- PingPongPlatformNotification({int maxCompletedRequestIds = 128})
- Creates a notification that matches one active request to one response.
Properties
- activeRequestId → String?
-
The request id currently waiting for a terminal response.
no setter
- docking ↔ bool
-
A flag for the docking state of the notification.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxCompletedRequestIds → int
-
The maximum number of completed request ids retained for duplicate checks.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
subscribers
↔ Map<
String, Function> -
A map of subscribers for the notification.
getter/setter pairinherited
- throttlingSignal ↔ Signal
-
A signal for throttling the notification.
getter/setter pairinherited
Methods
-
completeActiveRequest(
) → void - Marks the current active request as completed.
-
completeRequest(
String? requestId) → void -
Marks
requestIdas completed and clears it if it is active. -
dockingOff(
) → void -
A method for docking off the notification.
inherited
-
dockingOn(
) → void -
A method for docking on the notification.
inherited
-
getSubscriptions(
) → List< String> -
A method for getting the subscriptions of the notification.
inherited
-
isActiveRequestId(
String? requestId) → bool -
Whether
requestIdmatches the active request and has not completed. -
isTerminalResponse(
String method) → bool - Whether a callback method should complete the active request.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onRequest(
String? requestId, dynamic arguments) → void - Called after a request id is created for outgoing platform arguments.
-
onRequestIgnored(
String method, dynamic arguments) → void - Called when a callback is ignored because it does not match the active request.
-
onResponse(
String? requestId, dynamic arguments) → void - Called before subscriber callbacks receive a matching response.
-
receiver(
String method, dynamic arguments) → dynamic -
Receives a native callback and dispatches it when it matches the active request.
override
-
requestArguments(
dynamic arguments) → Map< String, dynamic> - Creates a new request id and wraps the platform arguments with it.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
requestIdFrom(
dynamic arguments) → String? - Extracts a request id from map or JSON string callback arguments.
-
responseDataFrom(
dynamic arguments) → dynamic - Extracts response data from callback arguments.
Constants
- requestArgumentsKey → const String
- The payload key used to store the original request arguments.
- requestIdKey → const String
- The payload key used to store the generated request id.
- responseDataKey → const String
- The payload key used to store response data in native callbacks.