ServiceClient class abstract

Base class for service clients.

Each service client wraps a specific native service, providing a typed Dart API for its commands and events.

Implementers

Constructors

ServiceClient(NativeBridge _bridge)
Create a service client with the given bridge.

Properties

bridge NativeBridge
Protected access to bridge for subclasses that need direct bridge access.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceName String
The service name (must match native side).
no setter

Methods

dispose() → void
Clean up all subscriptions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onEvent(String eventName, void callback(NativeEvent)) → void
Subscribe to events from this service.
onWindowEvent(String windowId, String eventName, void callback(NativeEvent)) → void
Subscribe to events for a specific window.
send<T>(String command, {String? windowId, Map<String, dynamic>? params}) Future<T?>
Send a command to this service.
sendFireAndForget(String command, {String? windowId, Map<String, dynamic>? params}) → void
Send a command, fire and forget.
sendForMap(String command, {String? windowId, Map<String, dynamic>? params}) Future<Map<String, dynamic>?>
Send a command expecting a Map result.
toString() String
A string representation of this object.
inherited

Operators

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