// Normalised coordinates: x and y are in the range 0..1 relative to the floor plan canvas. class Position { const Position({required this.x, required this.y}); final double x; final double y; Position copyWith({double? x, double? y}) => Position(x: x ?? this.x, y: y ?? this.y); // Key names should match localiserd API fields. Map toJson() => {'x': x, 'y': y}; factory Position.fromJson(Map json) => Position( x: (json['x'] as num).toDouble(), y: (json['y'] as num).toDouble(), ); @override bool operator ==(Object other) => other is Position && other.x == x && other.y == y; @override int get hashCode => Object.hash(x, y); }