FloatyProxyClient class final

Overlay-side proxy client that calls services on the main app, e.g. await FloatyProxyClient().call('location', 'getCurrentPosition').

Throws FloatyProxyDisconnectedException when the main app is not connected (unless a fallback is given), FloatyProxyTimeoutException when the call takes longer than timeout, and FloatyProxyErrorException when the host handler threw.

Constructors

FloatyProxyClient({Duration timeout})
Creates a client whose calls time out after timeout.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timeout → Duration
Default timeout for each proxy call.
final

Methods

call(String service, String method, {Map<String, dynamic> params = const {}, Object? fallback()?}) → Future<Object?>
Calls method of service on the main app and returns its result.
dispose() → void
Releases resources and cancels all pending requests.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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