removeAnchor method

Future<void> removeAnchor(
  1. String id, {
  2. bool removeNodes = true,
})

Implementation

Future<void> removeAnchor(String id, {bool removeNodes = true}) async {
  await _invoke<void>("removeAnchor", <String, Object?>{"id": id, "removeNodes": removeNodes});
  _gpsAnchors.remove(id);
  final Map<String, UArAnchor> anchors = Map<String, UArAnchor>.of(value.anchors)..remove(id);
  final Map<String, UArNode> nodes = removeNodes ? (Map<String, UArNode>.of(value.nodes)..removeWhere((String _, UArNode n) => n.anchorId == id)) : value.nodes;
  value = value.copyWith(anchors: anchors, nodes: nodes);
}