UArController class
Drives one AR (or 3D viewer) session. Hand it to a UArView; the view creates the native session and the controller talks to it.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
UArValue> - UArController
Constructors
- UArController({UArConfig config = const UArConfig()})
Properties
-
collaborationData
→ Stream<
Uint8List> -
ARKit collaboration packets to send to the other devices.
no setter
- config → UArConfig
-
no setter
-
errors
→ Stream<
UArException> -
no setter
- floorHeight → double?
-
Height of the lowest horizontal plane, a good guess for the floor.
no setter
-
frames
→ Stream<
UArFrame> -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
imageEvents
→ Stream<
UArTrackedImage> -
Every image detection or update, including when tracking is lost.
no setter
- isDisposed → bool
-
no setter
- lastPosition → Position?
-
no setter
-
nodeEvents
→ Stream<
Map< String, Object?> > -
Node events:
{"id", "event": loaded | animationEnded | videoEnded | error, "message"}.no setter -
projections
→ ValueNotifier<
Map< String, UArProjection> > -
final
-
ready
→ Future<
void> -
Resolves once the native session has started.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sessionId → int?
-
no setter
- value ↔ UArValue
-
The current value stored in this notifier.
getter/setter pairinherited
- viewSize → Size
-
no setter
Methods
-
addAnchor(
UArPose pose, {String? id, String? trackableId, String? name}) → Future< UArAnchor> -
addAnchorAtHit(
UArHitResult hit, {String? id, bool faceCamera = true}) → Future< UArAnchor> - Anchors to the surface of a hit, so the content follows plane refinements.
-
addGeoAnchor(
{required double latitude, required double longitude, double altitude = 0, UArAltitudeMode altitudeMode = UArAltitudeMode.terrain, double heading = 0, String? id}) → Future< UArAnchor> - Pins an anchor to a real-world coordinate. Uses visual positioning when the device and location support it, else GPS + compass.
-
addLine(
String id, UArVector3 from, UArVector3 to, {double thickness = 0.004, Color color = const Color(0xFFFFFFFF), bool renderOnTop = true}) → Future< UArNodeInfo> - Draws a measuring bar between two world points.
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
addNode(
UArNode node) → Future< UArNodeInfo> - Adds (or replaces) a node. Completes when the model or texture is loaded.
-
addNodes(
List< UArNode> nodes) → Future<List< UArNodeInfo> > -
addWidgetNode(
{required String id, required Widget child, Size size = const Size(320, 200), double width = 0.3, double pixelRatio = 3, BuildContext? context, String? anchorId, String? parentId, UArVector3 position = UArVector3.zero, UArQuaternion rotation = UArQuaternion.identity, UArBillboard billboard = UArBillboard.yAxis, bool renderOnTop = false, Duration settle = const Duration(milliseconds: 50)}) → Future< UArNodeInfo?> -
Renders a Flutter widget into an image node — info cards, price tags,
labels.
widthis the size in metres; height followssize's aspect. -
attachPlatformView(
int viewId) → Future< void> - Called by UArView once the iOS platform view exists.
-
attachSurface(
Size size, double pixelRatio) → Future< void> -
cameraImage(
{int maxSize = 1024}) → Future< UArCameraImage?> -
checkVpsAvailability(
double latitude, double longitude) → Future< UArVpsAvailability> -
clearNodes(
) → Future< void> -
clearTracks(
) → Future< void> -
controlVideo(
String nodeId, {bool? play, Duration? seek, double? volume}) → Future< void> - Play / pause / seek a video node.
-
detectCodes(
{UCodeScanOptions options = const UCodeScanOptions(multiple: true)}) → Future< List< UArCodeResult> > - Reads QR codes and barcodes in view — Apple Vision on iOS, the bundled Dart decoder on the camera frame elsewhere.
-
dispose(
) → void -
Discards any resources used by the object.
override
-
distanceToCamera(
UArVector3 point) → double -
enterXr(
) → Future< bool> - Web only: starts the immersive WebXR (or camera + compass) session. Must be called from a user gesture such as a button tap.
-
exitXr(
) → Future< void> -
getWorldMap(
) → Future< Uint8List?> - Serialised ARKit world map; pass it back through UArConfig.worldMap.
-
hitTest(
Offset point, {List< UArHitType> types = const <UArHitType>[UArHitType.plane, UArHitType.depth, UArHitType.point, UArHitType.estimated, UArHitType.instant, UArHitType.mesh]}) → Future<List< UArHitResult> > - Real-world surfaces under a point of the view (logical pixels), nearest first.
-
hitTestCenter(
{List< UArHitType> types = const <UArHitType>[UArHitType.plane, UArHitType.depth, UArHitType.point, UArHitType.estimated, UArHitType.instant, UArHitType.mesh]}) → Future<List< UArHitResult> > - Same as hitTest from the middle of the view.
-
hitTestNodes(
Offset point) → Future< UArNodeHit?> - The node under a point of the view, if any.
-
hostCloudAnchor(
String anchorId, {int ttlDays = 1}) → Future< String> - Uploads an anchor to Google Cloud Anchors and returns its cloud id.
-
newId(
[String prefix = "n"]) → String -
nodePose(
String id) → Future< UArPose?> - World pose of a node right now.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
pause(
) → Future< void> -
planesOf(
{UArPlaneType? type, UArPlaneClassification? classification}) → List< UArPlane> - Planes of one kind, largest first.
-
playAnimation(
String nodeId, {String? name, int index = 0, bool loop = true, double speed = 1}) → Future< void> -
recognizeText(
{List< String> languages = const <String>[], bool accurate = true}) → Future<List< UArTextResult> > - Reads text in view (shop signs, labels). iOS only — Apple Vision.
-
refreshGeoAnchors(
) → Future< void> - Re-places GPS anchors from the latest fix and heading. Call after the position accuracy improves or when the user walks a long way.
-
removeAnchor(
String id, {bool removeNodes = true}) → Future< void> -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
removeNode(
String id) → Future< void> -
reportUnsupported(
) → void - Called by UArView on platforms with no AR / 3D support.
-
reset(
{bool keepNodes = false}) → Future< void> - Restarts tracking. Anchors and nodes are dropped unless kept.
-
resolveCloudAnchor(
String cloudId, {String? id}) → Future< UArAnchor> -
resume(
) → Future< void> -
sendCollaborationData(
Uint8List data) → Future< void> -
setNodeVisible(
String id, bool visible) → Future< void> -
setOrbit(
UArOrbit orbit) → Future< void> -
startLocationUpdates(
{int distanceFilter = 1}) → Future< void> - Streams the device position for GPS placement. Started automatically.
-
startRecording(
{bool audio = false}) → Future< void> -
stopAnimation(
String nodeId) → Future< void> -
stopRecording(
) → Future< UArRecording?> -
takeSnapshot(
{UArImageFormat format = UArImageFormat.jpeg, int quality = 92}) → Future< Uint8List?> -
toString(
) → String -
A string representation of this object.
inherited
-
track(
String id, {String? nodeId, String? anchorId, UArVector3 offset = UArVector3.zero}) → Future< void> -
Reports every frame where a node, an anchor or a world point lands on the
view, through projections.
offsetis local to the node / anchor. -
transformNode(
String id, {UArVector3? position, UArQuaternion? rotation, UArVector3? scale, bool world = false}) → Future< void> - Lightweight transform change, cheap enough to call every frame.
-
untrack(
String id) → Future< void> -
updateAnchor(
String id, UArPose pose) → Future< void> - Moves an existing anchor; attached nodes follow.
-
updateConfig(
UArConfig config) → Future< void> -
updateNode(
UArNode node) → Future< void> - Re-sends every property of a node already in the scene.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited