NativeBridge class
Single bridge to native layer.
All communication with native goes through this class. Services use this to send commands and receive events.
- Implementers
Constructors
- NativeBridge({String channelName = 'floating_palette', Duration commandTimeout = const Duration(seconds: 5)})
- Create a new NativeBridge.
Properties
- commandTimeout → Duration
-
Timeout for commands sent to native.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void - Dispose resources.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send<
T> (NativeCommand command) → Future< T?> - Send a command to native.
-
sendFireAndForget(
NativeCommand command) → void - Send a command, fire and forget (no result expected).
-
sendForMap(
NativeCommand command) → Future< Map< String, dynamic> ?> - Send a command and expect a Map result.
-
subscribe(
String service, NativeEventCallback callback) → void - Subscribe to events from a specific service.
-
subscribeAll(
NativeEventCallback callback) → void - Subscribe to all events (global listener).
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribe(
String service, NativeEventCallback callback) → void - Unsubscribe from events.
-
unsubscribeAll(
NativeEventCallback callback) → void - Unsubscribe from all events.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited