SnapClient class
Client for SnapService.
Handles palette-to-palette snapping. All snap logic lives in native for zero-latency follower movement.
- Inheritance
-
- Object
- ServiceClient
- SnapClient
Constructors
- SnapClient(NativeBridge bridge)
Properties
- bridge → NativeBridge
-
Protected access to bridge for subclasses that need direct bridge access.
no setterinherited
- 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 setteroverride
Methods
-
detach(
String followerId) → Future< void> - Detach a follower from its snap target.
-
disableAutoSnap(
String paletteId) → Future< void> - Disable auto-snap for a palette.
-
dispose(
) → void -
Clean up all subscriptions.
inherited
-
getSnapDistance(
String followerId) → Future< double> - Get current distance from follower to its snap position.
-
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.
inherited
-
onSnapEvent(
String followerId, void callback(SnapEvent)) → void - Listen for snap events on a specific follower.
-
onWindowEvent(
String windowId, String eventName, void callback(NativeEvent)) → void -
Subscribe to events for a specific window.
inherited
-
reSnap(
String followerId) → Future< void> - Re-snap follower to its target's snap position.
-
send<
T> (String command, {String? windowId, Map< String, dynamic> ? params}) → Future<T?> -
Send a command to this service.
inherited
-
sendFireAndForget(
String command, {String? windowId, Map< String, dynamic> ? params}) → void -
Send a command, fire and forget.
inherited
-
sendForMap(
String command, {String? windowId, Map< String, dynamic> ? params}) → Future<Map< String, dynamic> ?> -
Send a command expecting a Map result.
inherited
-
setAutoSnapConfig(
String paletteId, AutoSnapConfig config) → Future< void> - Register auto-snap configuration for a palette.
-
snap(
{required String followerId, required String targetId, required SnapEdge followerEdge, required SnapEdge targetEdge, SnapAlignment alignment = SnapAlignment.center, double gap = 0, SnapConfig config = const SnapConfig()}) → Future< void> - Snap a follower palette to a target palette.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited