currentPosition method
获取 Floating 位置(异步实现):发送 setPoint 命令并等待视图返回 Point
Implementation
Future<FPosition<double>?> currentPosition() async {
final c = Completer<dynamic>();
final cmd = _ControllerCommand(ControllerEnumType.getPoint, completer: c);
try {
_commandController.add(cmd);
} catch (_) {
c.complete(null);
}
if (!_hasListeners) c.complete(null);
final res = await c.future;
return res is FPosition<double> ? res : null;
}