FloatyProxyClient class final
Overlay-side proxy client that calls services on the main app.
Send requests to service providers registered on FloatyProxyHost and await results.
final client = FloatyProxyClient();
final result = await client.call('location', 'getCurrentPosition');
// result == {'lat': 12.0, 'lng': -86.0}
Throws FloatyProxyDisconnectedException if the main app is not
connected (unless a fallback is provided),
FloatyProxyTimeoutException if the call takes longer than
timeout, and FloatyProxyErrorException if the host handler
threw.
Constructors
- FloatyProxyClient({Duration timeout = const Duration(seconds: 10)})
- Overlay-side proxy client that calls services on the main app.
Properties
Methods
-
call(
String service, String method, {Map< String, dynamic> params = const {}, Object? fallback()?}) → Future<Object?> - Calls a service method on the main app.
-
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