FloatyProxyHost class final

Main-app-side proxy host that registers service providers.

The overlay can call services registered here via FloatyProxyClient. Each service exposes named methods that accept parameters and return results — all serialized as JSON through the shared data channel.

final host = FloatyProxyHost();

host.register('location', (method, params) async {
  if (method == 'getCurrentPosition') {
    final pos = await Geolocator.getCurrentPosition();
    return {'lat': pos.latitude, 'lng': pos.longitude};
  }
  return null;
});

Constructors

FloatyProxyHost()
Main-app-side proxy host that registers service providers.

Properties

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
Releases resources and unregisters the channel handler.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(String service, FutureOr<Object?> handler(String method, Map<String, dynamic> params)) → void
Registers a service provider.
toString() String
A string representation of this object.
inherited
unregister(String service) → void
Removes a registered service provider.

Operators

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