### Add ar_flutter_plugin to Project Source: https://pub.dev/documentation/ar_flutter_plugin/latest/index.html Install the ar_flutter_plugin package using the Flutter CLI. ```bash flutter pub add ar_flutter_plugin ``` -------------------------------- ### startLocationUpdates Method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager/startLocationUpdates.html Starts high precision location updates to keep track of the device's position. It automatically queries user permission if possible and returns true if successful, or an error if permissions do not suffice. ```APIDOC ## startLocationUpdates() ### Description Starts high precision location updates to keep track of the device's position. Returns true or an error, if permissions don't suffice. Automatically queries user permission if possible. ### Method Signature Future startLocationUpdates() ### Returns - `Future`: Resolves to `true` if location updates are successfully started, otherwise returns a `Future.error` with a message indicating the reason (e.g., 'Location services disabled', 'Location permissions denied', 'Location permissions permanently denied'). ### Implementation Notes This method first checks if location services are enabled. If not, it returns an error. It then checks for location permissions, requesting them if denied. If permissions are permanently denied, it returns an error. Upon successful permission grant, it sets up a stream for high accuracy location updates and returns `true`. ``` -------------------------------- ### currentLocation Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager-class.html Gets or sets the current position of the device. ```APIDOC ## currentLocation ### Description Provides access to the current geographical position of the device. This is a getter/setter pair. ### Property - **currentLocation** (Position) - Gets or sets the current position. ``` -------------------------------- ### onPanStart Property Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_object_manager/ARObjectManager/onPanStart.html The onPanStart property is a getter/setter pair that accepts a NodePanStartHandler. This handler is invoked when a pan gesture begins on an AR object, allowing for custom logic to be executed at the start of the gesture. ```APIDOC ## onPanStart Property ### Description This property is a handler that is called when a pan gesture starts on an AR object. It allows you to define custom behavior for the beginning of a pan gesture. ### Type `NodePanStartHandler?` ### Implementation ```dart NodePanStartHandler? onPanStart; ``` ### Usage Assign a function or method that matches the `NodePanStartHandler` signature to this property to handle the pan start event. ``` -------------------------------- ### Open App Settings Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager/openAppPermissionSettings.html Call this method to open the current application's settings screen. This is useful for guiding users to grant necessary permissions. ```dart void openAppPermissionSettings() async { await Geolocator.openAppSettings(); } ``` -------------------------------- ### onRotationStart Property Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_object_manager/ARObjectManager/onRotationStart.html This property allows you to set a handler for when the rotation of an AR object starts. It is a getter/setter pair. ```APIDOC ## onRotationStart Property NodeRotationStartHandler? onRotationStart getter/setter pair ### Description This property allows you to register a callback function that will be executed when the rotation of an AR object begins. It acts as both a getter to retrieve the current handler and a setter to assign a new one. ### Type `NodeRotationStartHandler?` ### Usage ```dart // Set a handler ARObjectManager.onRotationStart = (node) { print('Rotation started for node: ${node.name}'); }; // Get the current handler var handler = ARObjectManager.onRotationStart; ``` ``` -------------------------------- ### Initialize Google Cloud Anchor Mode Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_anchor_manager/ARAnchorManager/initGoogleCloudAnchorMode.html Call this method to activate collaborative AR mode, which utilizes Google Cloud Anchors. Ensure the necessary platform setup is complete before invocation. ```dart initGoogleCloudAnchorMode() async { _channel.invokeMethod('initGoogleCloudAnchorMode', {}); } ``` -------------------------------- ### Get Platform Version Source: https://pub.dev/documentation/ar_flutter_plugin/latest/ar_flutter_plugin/ArFlutterPlugin/platformVersion.html This method invokes a platform channel to retrieve the version string from the native platform. Ensure the platform channel is set up correctly. ```dart static Future get platformVersion async { final String version = await _channel.invokeMethod('getPlatformVersion'); return version; } ``` -------------------------------- ### Implement Snapshot Capture Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_session_manager/ARSessionManager/snapshot.html Use this method to get an ImageProvider of the current AR scene. It invokes a platform channel method to retrieve the scene data as Uint8List. ```dart Future snapshot() async { final result = await _channel.invokeMethod('snapshot'); return MemoryImage(result!); } ``` -------------------------------- ### Start High Precision Location Updates Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager/startLocationUpdates.html Initiates high-precision location updates. It checks if location services are enabled and requests permissions if necessary. Returns true on success or an error if permissions are insufficient. Requires the Geolocator package. ```dart Future startLocationUpdates() async { bool serviceEnabled; LocationPermission permission; // Test if location services are enabled. serviceEnabled = await Geolocator.isLocationServiceEnabled(); if (!serviceEnabled) { // Location services are not enabled don't continue // accessing the position and request users of the // App to enable the location services. return Future.error('Location services disabled'); } permission = await Geolocator.checkPermission(); if (permission == LocationPermission.denied) { permission = await Geolocator.requestPermission(); if (permission == LocationPermission.denied) { // Permissions are denied, next time you could try // requesting permissions again (this is also where // Android's shouldShowRequestPermissionRationale // returned true. According to Android guidelines // your App should show an explanatory UI now. return Future.error('Location permissions denied'); } } if (permission == LocationPermission.deniedForever) { // Permissions are denied forever, handle appropriately. return Future.error('Location permissions permanently denied'); } // When we reach here, permissions are granted and we can // continue accessing the position of the device. locationStream = Geolocator.getPositionStream(locationSettings: LocationSettings(accuracy: LocationAccuracy.high)) .listen((Position position) { //print(position.latitude.toString() + ', ' + position.longitude.toString()); currentLocation = position; }); return true; } ``` -------------------------------- ### onPanStart Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_object_manager/ARObjectManager-class.html Callback function invoked when a pan gesture on a node begins. ```APIDOC ## onPanStart ### Description Callback function that is invoked when a pan gesture on a node starts. ### Parameters - **NodePanStartHandler?** - The callback function to handle the start of a pan gesture. ``` -------------------------------- ### Get Transform Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/transform.html Retrieves the current transformation matrix of the ARNode. ```APIDOC ## Get Transform ### Description Determines the receiver's transform. The transform is the combination of the position, rotation and scale defined below. So when the transform is set, the receiver's position, rotation and scale are changed to match the new transform. ### Method ```dart Matrix4 get transform ``` ``` -------------------------------- ### onInitialize Method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_object_manager/ARObjectManager/onInitialize.html Initializes the AR Object Manager by invoking the 'init' method on the platform channel. ```APIDOC ## onInitialize() ### Description Sets up the AR Object Manager. ### Method Signature `dynamic onInitialize()` ### Implementation Details This method invokes the 'init' method on the platform channel with an empty map as arguments. ``` -------------------------------- ### ARView Constructor Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/ARView/ARView.html Initializes the ARView widget with various configuration options. ```APIDOC ## ARView Constructor ### Description Initializes the ARView widget with various configuration options. ### Parameters #### Constructor Parameters - **key** (Key?) - Optional - Used for widget identification. - **onARViewCreated** (required ARViewCreatedCallback) - Required - Callback function invoked when the AR view is created. - **planeDetectionConfig** (PlaneDetectionConfig) - Optional - Configuration for plane detection. Defaults to `PlaneDetectionConfig.none`. - **showPlatformType** (bool) - Optional - Whether to display the platform type. Defaults to `false`. - **permissionPromptDescription** (String) - Optional - Custom text for the camera permission prompt. Defaults to a standard message. - **permissionPromptButtonText** (String) - Optional - Text for the button on the permission prompt. Defaults to "Grant Permission". - **permissionPromptParentalRestriction** (String) - Optional - Message displayed when camera permission is restricted by the OS. Defaults to a standard restriction message. ``` -------------------------------- ### Get Rotation Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/rotation.html Retrieves the current rotation of the ARNode as a Matrix3. ```APIDOC ## Get Rotation ### Description Determines the receiver's rotation. ### Method Signature `Matrix3 get rotation` ### Implementation ```dart Matrix3 get rotation => transform.getRotation(); ``` ``` -------------------------------- ### locationStream Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager-class.html Gets or sets a stream subscription for location updates. ```APIDOC ## locationStream ### Description Manages the subscription to a stream of location updates. This is a getter/setter pair. ### Property - **locationStream** (StreamSubscription) - Gets or sets the stream subscription for location updates. ``` -------------------------------- ### startLocationUpdates() Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager-class.html Initiates high-precision location updates, requesting permissions if necessary. ```APIDOC ## startLocationUpdates() ### Description Starts receiving high-precision location updates to continuously track the device's position. Returns true upon success or an error if permissions are insufficient. This method automatically attempts to query user permission if possible. ### Method `startLocationUpdates()` ### Returns - `Future` - A future that resolves to true if updates started successfully, or indicates an error. ``` -------------------------------- ### Get Scale Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/scale.html Retrieves the current scale of the ARNode. The scale is represented as a Vector3. ```APIDOC ## get scale ### Description Determines the receiver's scale. ### Returns - Vector3: The current scale of the ARNode. ``` -------------------------------- ### build Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/AndroidARView-class.html Builds the AR view widget. ```APIDOC ## Method ### build({BuildContext? context, ARViewCreatedCallback? arViewCreatedCallback, PlaneDetectionConfig? planeDetectionConfig}) → Widget Overrides the build method to construct the AR view. Allows for optional context, a callback for when the AR view is created, and plane detection configuration. ``` -------------------------------- ### ARView Constructor Implementation Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/ARView/ARView.html Shows the implementation of the ARView constructor, initializing the widget with provided or default values. ```dart ARView( {Key? key, required this.onARViewCreated, this.planeDetectionConfig = PlaneDetectionConfig.none, this.showPlatformType = false, this.permissionPromptDescription = "Camera permission must be given to the app for AR functions to work", this.permissionPromptButtonText = "Grant Permission", this.permissionPromptParentalRestriction = "Camera permission is restriced by the OS, please check parental control settings"}) : super(key: key); ``` -------------------------------- ### initGoogleCloudAnchorMode Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_anchor_manager/ARAnchorManager-class.html Activates collaborative AR mode using Google Cloud Anchors. ```APIDOC ## initGoogleCloudAnchorMode() ### Description Activates the collaborative AR mode, which utilizes Google Cloud Anchors for shared AR experiences. ### Returns - **dynamic** - The result of activating the mode. ``` -------------------------------- ### Get Matrix Euler Angles Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/Matrix4Extenstion/matrixEulerAngles.html Retrieves the Euler angles (roll, pitch, yaw) from the current matrix transformation. ```APIDOC ## get matrixEulerAngles ### Description Retrieves the Euler angles (roll, pitch, yaw) from the current matrix transformation. ### Method Getter ### Return Value Vector3 - A Vector3 object representing the Euler angles (x: roll, y: pitch, z: yaw). ``` -------------------------------- ### Get ARNode Position Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/position.html Retrieves the current position of the ARNode in 3D space. The position is returned as a Vector3 object. ```APIDOC ## get position ### Description Determines the receiver's position. ### Return Value - **Vector3**: The current position of the ARNode. ``` -------------------------------- ### onRotationStart Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_object_manager/ARObjectManager-class.html Callback function invoked when a rotation gesture on a node begins. ```APIDOC ## onRotationStart ### Description Callback function that is invoked when a rotation gesture on a node starts. ### Parameters - **NodeRotationStartHandler?** - The callback function to handle the start of a rotation gesture. ``` -------------------------------- ### Get ARNode Rotation Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/rotation.html Retrieves the current rotation of the ARNode as a Matrix3 object. This is useful for reading the node's orientation. ```dart Matrix3 get rotation => transform.getRotation(); ``` -------------------------------- ### Get ARNode Scale Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/scale.html Retrieves the current scale of the ARNode. This is determined by the scale component of the node's transformation matrix. ```dart Vector3 get scale => transform.matrixScale; ``` -------------------------------- ### openAppPermissionSettings() Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager-class.html Opens the application's permission settings screen. ```APIDOC ## openAppPermissionSettings() ### Description Navigates the user to the current application's permission settings screen, allowing them to manage location permissions. ### Method `openAppPermissionSettings()` ### Returns - `void` ``` -------------------------------- ### NodeRotationStartHandler Typedef Definition Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_object_manager/NodeRotationStartHandler.html Defines the signature for a callback function that accepts a String representing the node identifier when a rotation starts. ```dart typedef NodeRotationStartHandler = void Function(String node); ``` -------------------------------- ### build Method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/PlatformARView-class.html Builds the AR view widget, allowing for customization and callback registration. ```APIDOC ## build({BuildContext context, ARViewCreatedCallback arViewCreatedCallback, PlaneDetectionConfig planeDetectionConfig}) ### Description Builds the AR view widget. ### Parameters - **context** (BuildContext) - Optional - The build context for the widget. - **arViewCreatedCallback** (ARViewCreatedCallback) - Optional - A callback function that is invoked when the AR view is created. - **planeDetectionConfig** (PlaneDetectionConfig) - Optional - Configuration for plane detection. ``` -------------------------------- ### ARPlaneAnchor Constructor Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_anchor/ARPlaneAnchor/ARPlaneAnchor.html Initializes a new ARPlaneAnchor with a required transformation matrix and optional parameters for name, child nodes, cloud anchor ID, and time-to-live. ```APIDOC ## ARPlaneAnchor Constructor ### Description Creates a new ARPlaneAnchor instance. ### Parameters #### Path Parameters - **transformation** (Matrix4) - Required - The transformation matrix defining the anchor's position and orientation. - **name** (String?) - Optional - The name of the anchor. - **childNodes** (List?) - Optional - A list of child node identifiers. - **cloudanchorid** (String?) - Optional - The ID of the cloud anchor. - **ttl** (int?) - Optional - The time-to-live for the anchor in seconds. ``` -------------------------------- ### Get ARNode Transform Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/transform.html Retrieves the current transform matrix of the ARNode. This matrix encapsulates the node's position, rotation, and scale. ```dart Matrix4 get transform => transformNotifier.value; ``` -------------------------------- ### Get ARNode Position Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/position.html Retrieves the current 3D position of the ARNode. This is useful for reading the node's location in the AR scene. ```dart Vector3 get position => transform.getTranslation(); ``` -------------------------------- ### IosARView Constructors Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/IosARView-class.html Initializes a new instance of the IosARView class. ```APIDOC ## IosARView() ### Description Initializes a new instance of the IosARView class. ### Constructor IosARView() ``` -------------------------------- ### Get eulerAngles Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/eulerAngles.html Retrieves the current Euler angles of the ARNode as a Vector3 object. The components represent pitch, yaw, and roll rotations in radians. ```APIDOC ## Get eulerAngles ### Description Determines the receiver's euler angles. The order of components in this vector matches the axes of rotation: 1. Pitch (the x component) is the rotation about the node's x-axis (in radians) 2. Yaw (the y component) is the rotation about the node's y-axis (in radians) 3. Roll (the z component) is the rotation about the node's z-axis (in radians) ### Method GET ### Endpoint /ARNode/eulerAngles ### Response #### Success Response (200) - **eulerAngles** (Vector3) - The Euler angles of the node in radians. ``` -------------------------------- ### onInitialize Method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_session_manager/ARSessionManager/onInitialize.html Initializes the platform-specific AR view. This method can be used to set or update session settings such as plane detection, gesture handling, and visual aids. `customPlaneTexturePath` should point to assets within your application, not the plugin itself, and must be registered in your `pubspec.yaml`. ```APIDOC ## onInitialize ### Description Initializes the platform-specific AR view with customizable settings. ### Parameters - **showAnimatedGuide** (bool) - Optional - Defaults to `true`. Whether to show an animated guide. - **showFeaturePoints** (bool) - Optional - Defaults to `false`. Whether to show feature points. - **showPlanes** (bool) - Optional - Defaults to `true`. Whether to show detected planes. - **customPlaneTexturePath** (String?) - Optional - Path to a custom texture for planes from app assets. - **showWorldOrigin** (bool) - Optional - Defaults to `false`. Whether to show the world origin. - **handleTaps** (bool) - Optional - Defaults to `true`. Whether to enable tap gestures. - **handlePans** (bool) - Optional - Defaults to `false`. Whether to enable pan gestures. - **handleRotation** (bool) - Optional - Defaults to `false`. Whether to enable rotation gestures. ### Implementation Example ```dart onInitialize({ bool showAnimatedGuide = true, bool showFeaturePoints = false, bool showPlanes = true, String? customPlaneTexturePath, bool showWorldOrigin = false, bool handleTaps = true, bool handlePans = false, bool handleRotation = false, }) { // ... implementation details ... } ``` ``` -------------------------------- ### Get ARNode Euler Angles Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/eulerAngles.html Retrieves the current Euler angles of the ARNode. The order of components is Pitch (x), Yaw (y), and Roll (z), all in radians. ```dart Vector3 get eulerAngles => transform.matrixEulerAngles; ``` -------------------------------- ### onPlatformViewCreated Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/AndroidARView-class.html Callback function executed once the platform view is established. ```APIDOC ## Method ### onPlatformViewCreated(int id) → void Callback function that is executed once the view is established. It receives the unique ID of the created platform view. ``` -------------------------------- ### snapshot method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_session_manager/ARSessionManager/snapshot.html Returns a future ImageProvider that contains a screenshot of the current AR Scene. ```APIDOC ## snapshot method ### Description Returns a future ImageProvider that contains a screenshot of the current AR Scene. ### Method Signature Future> snapshot() ### Implementation Details This method internally invokes a platform channel method 'snapshot' and returns a MemoryImage created from the received Uint8List. ``` -------------------------------- ### ARPlaneAnchor Constructor Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_anchor/ARPlaneAnchor-class.html Initializes a new ARPlaneAnchor with specified transformation and optional parameters. ```APIDOC ## ARPlaneAnchor Constructor ### Description Initializes a new ARPlaneAnchor with the given transformation matrix and optional properties such as name, child nodes, cloud anchor ID, and time-to-live. ### Parameters - **transformation** (Matrix4) - Required - The transformation matrix defining the anchor's position, rotation, and scale in world coordinates. - **name** (String?) - Optional - The name of the ARPlaneAnchor. If not provided, it will be autogenerated. - **childNodes** (List?) - Optional - A list of names of ARNodes attached to this anchor. - **cloudanchorid** (String?) - Optional - The ID associated with the anchor after uploading it to the Google Cloud Anchor API. - **ttl** (int?) - Optional - The time to live for the anchor in hours. Defaults to 24 hours. ``` -------------------------------- ### Get Distance from Anchor to Camera Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_session_manager/ARSessionManager/getDistanceFromAnchor.html Calculates the distance in meters between an AR anchor and the device's camera. Returns null if camera or anchor poses cannot be retrieved. ```dart Future getDistanceFromAnchor(ARAnchor anchor) async { Matrix4? cameraPose = await getCameraPose(); Matrix4? anchorPose = await getPose(anchor); Vector3? cameraTranslation = cameraPose?.getTranslation(); Vector3? anchorTranslation = anchorPose?.getTranslation(); if (anchorTranslation != null && cameraTranslation != null) { return getDistanceBetweenVectors(anchorTranslation, cameraTranslation); } else { return null; } } ``` -------------------------------- ### downloadAnchor method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_anchor_manager/ARAnchorManager/downloadAnchor.html Downloads an anchor with the given ID from the Google Cloud Anchor API and adds it to the scene. ```APIDOC ## downloadAnchor ### Description Try to download anchor with the given ID from the Google Cloud Anchor API and add it to the scene. ### Method Signature Future downloadAnchor(String cloudanchorid) ### Parameters #### Path Parameters - **cloudanchorid** (String) - Required - The ID of the cloud anchor to download. ### Implementation ```dart Future downloadAnchor(String cloudanchorid) async { print("TRYING TO DOWNLOAD ANCHOR WITH ID " + cloudanchorid); _channel .invokeMethod('downloadAnchor', {"cloudanchorid": cloudanchorid}); } ``` ``` -------------------------------- ### Get Camera Pose - ARSessionManager Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_session_manager/ARSessionManager/getCameraPose.html Retrieves the camera's pose as a Matrix4 object. Handles potential errors during the invocation and returns null if an error occurs. ```dart Future getCameraPose() async { try { final serializedCameraPose = await _channel.invokeMethod>('getCameraPose', {}); return MatrixConverter().fromJson(serializedCameraPose!); } catch (e) { print('Error caught: ' + e.toString()); return null; } } ``` -------------------------------- ### ARPlaneAnchor Static Methods Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_anchor/ARPlaneAnchor-class.html Static methods available for creating ARPlaneAnchor instances. ```APIDOC ## ARPlaneAnchor Static Methods ### fromJson - **Description**: Creates an ARPlaneAnchor instance from a JSON map. - **Parameters**: - **json** (Map) - The JSON map to deserialize. - **Returns**: ARPlaneAnchor ``` -------------------------------- ### Get Distance Between AR Anchors Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_session_manager/ARSessionManager/getDistanceBetweenAnchors.html Retrieves the poses of two anchors, extracts their translation vectors, and calculates the distance between them in meters. Returns null if anchor poses cannot be obtained. ```dart Future getDistanceBetweenAnchors( ARAnchor anchor1, ARAnchor anchor2) async { var anchor1Pose = await getPose(anchor1); var anchor2Pose = await getPose(anchor2); var anchor1Translation = anchor1Pose?.getTranslation(); var anchor2Translation = anchor2Pose?.getTranslation(); if (anchor1Translation != null && anchor2Translation != null) { return getDistanceBetweenVectors(anchor1Translation, anchor2Translation); } else { return null; } } ``` -------------------------------- ### ARUnkownAnchor Constructor Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_anchor/ARUnkownAnchor/ARUnkownAnchor.html Initializes a new ARUnkownAnchor instance. It requires an AnchorType and a transformation matrix, and optionally accepts a name. ```APIDOC ## ARUnkownAnchor constructor ### Description Initializes a new ARUnkownAnchor instance. It requires an AnchorType and a transformation matrix, and optionally accepts a name. ### Parameters #### Path Parameters - **type** (AnchorType) - Required - The type of the anchor. - **transformation** (Matrix4) - Required - The transformation matrix representing the anchor's pose. - **name** (String?) - Optional - The name of the anchor. ``` -------------------------------- ### PlatformARView Build Method Implementation Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/PlatformARView/build.html This shows the concrete implementation signature for the build method, which is required for subclasses. ```dart Widget build( {@required BuildContext context, @required ARViewCreatedCallback arViewCreatedCallback, @required PlaneDetectionConfig planeDetectionConfig}); ``` -------------------------------- ### Get Euler Angles from Matrix4 Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/Matrix4Extenstion/matrixEulerAngles.html Retrieves the Euler angles (roll, pitch, yaw) from a Matrix4. This getter decomposes the matrix into translation, rotation (quaternion), and scale, then calculates the angles. ```dart Vector3 get matrixEulerAngles { final q = Quaternion(0, 0, 0, 0); decompose(Vector3.zero(), q, Vector3.zero()); final t = q.x; q.x = q.y; q.y = t; final angles = Vector3.zero(); // roll (x-axis rotation) final sinrCosp = 2 * (q.w * q.x + q.y * q.z); final cosrCosp = 1 - 2 * (q.x * q.x + q.y * q.y); angles[0] = math.atan2(sinrCosp, cosrCosp); // pitch (y-axis rotation) final sinp = 2 * (q.w * q.y - q.z * q.x); if (sinp.abs() >= 1) { angles[1] = _copySign(math.pi / 2, sinp); // use 90 degrees if out of range } else { angles[1] = math.asin(sinp); } // yaw (z-axis rotation) final sinyCosp = 2 * (q.w * q.z + q.x * q.y); final cosyCosp = 1 - 2 * (q.y * q.y + q.z * q.z); angles[2] = math.atan2(sinyCosp, cosyCosp); return angles; } ``` -------------------------------- ### Get Matrix Scale (Dart) Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/Matrix4Extenstion/matrixScale.html Retrieves the scale components (X, Y, Z) from a Matrix4 transformation. This property is useful when you need to determine how much an object has been scaled along each axis. ```dart Vector3 get matrixScale { final scale = Vector3.zero(); decompose(Vector3.zero(), Quaternion(0, 0, 0, 0), scale); return scale; } ``` -------------------------------- ### onPlatformViewCreated Method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/PlatformARView-class.html Callback function executed once the platform view is established. ```APIDOC ## onPlatformViewCreated(int id) ### Description Callback function that is executed once the view is established. ### Parameters - **id** (int) - Required - The unique identifier of the created platform view. ``` -------------------------------- ### Initialize AR Session with Custom Settings Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_session_manager/ARSessionManager/onInitialize.html Call this method to initialize the AR view and set session configurations. `customPlaneTexturePath` should reference assets from your app, not the plugin. ```dart onInitialize({ bool showAnimatedGuide = true, bool showFeaturePoints = false, bool showPlanes = true, String? customPlaneTexturePath, bool showWorldOrigin = false, bool handleTaps = true, bool handlePans = false, // nodes are not draggable by default bool handleRotation = false, // nodes can not be rotated by default }) { _channel.invokeMethod('init', { 'showAnimatedGuide': showAnimatedGuide, 'showFeaturePoints': showFeaturePoints, 'planeDetectionConfig': planeDetectionConfig.index, 'showPlanes': showPlanes, 'customPlaneTexturePath': customPlaneTexturePath, 'showWorldOrigin': showWorldOrigin, 'handleTaps': handleTaps, 'handlePans': handlePans, 'handleRotation': handleRotation, }); } ``` -------------------------------- ### build Method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/IosARView/build.html The build method is responsible for creating the ARView widget and passing necessary configurations to the platform side. ```APIDOC ## build Method ### Description Builds the ARView widget, initializing it with optional parameters and setting up the platform view. ### Method Signature ```dart Widget build({ BuildContext? context, ARViewCreatedCallback? arViewCreatedCallback, PlaneDetectionConfig? planeDetectionConfig, }) ``` ### Parameters - **context** (BuildContext?) - The build context for the widget. - **arViewCreatedCallback** (ARViewCreatedCallback?) - A callback function that is invoked when the AR view is created on the platform side. - **planeDetectionConfig** (PlaneDetectionConfig?) - Configuration for plane detection in the AR experience. ### Implementation Details The method sets up a `UiKitView` which is a platform view that hosts the AR functionality. It passes a `viewType` and `creationParams` to the platform channel for initialization. ``` -------------------------------- ### ARView Constructor Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/ARView-class.html Instantiates an ARView widget. It requires an onARViewCreated callback and optionally accepts planeDetectionConfig, showPlatformType, and parameters for customizing permission prompts. ```APIDOC ## ARView Constructor ### Description Creates an instance of the ARView widget. ### Parameters - **key** (Key?): Optional key for widget identification. - **onARViewCreated** (ARViewCreatedCallback): Required callback function to be invoked when the AR view is successfully created. This callback receives managers for AR session and objects. - **planeDetectionConfig** (PlaneDetectionConfig): Optional configuration for plane detection. Defaults to `PlaneDetectionConfig.none`. - **showPlatformType** (bool): Optional boolean to display the device's platform type above the AR view. Defaults to `false`. - **permissionPromptDescription** (String): Optional text for the camera permission prompt description. Defaults to "Camera permission must be given to the app for AR functions to work". - **permissionPromptButtonText** (String): Optional text for the permission prompt button. Defaults to "Grant Permission". - **permissionPromptParentalRestriction** (String): Optional text for parental restriction prompts. Defaults to "Camera permission is restriced by the OS, please check parental control settings". ``` -------------------------------- ### Get AR Anchor Pose Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_session_manager/ARSessionManager/getPose.html Retrieves the pose of an AR anchor in Matrix4 format. Throws an exception if the anchor name is empty. Handles potential errors during the invocation of the platform channel method. ```dart Future getPose(ARAnchor anchor) async { try { if (anchor.name.isEmpty) { throw Exception("Anchor can not be resolved. Anchor name is empty."); } final serializedCameraPose = await _channel.invokeMethod>('getAnchorPose', { "anchorId": anchor.name, }); return MatrixConverter().fromJson(serializedCameraPose!); } catch (e) { print('Error caught: ' + e.toString()); return null; } } ``` -------------------------------- ### PlatformARView build Method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/PlatformARView/build.html The abstract build method is used to create and configure the AR view. It requires a BuildContext, a callback for when the AR view is created, and configuration for plane detection. ```APIDOC ## build Method ### Description This abstract method is responsible for building the AR view. It takes necessary parameters to initialize and configure the AR experience. ### Signature ```dart Widget build({ @required BuildContext context, @required ARViewCreatedCallback arViewCreatedCallback, @required PlaneDetectionConfig planeDetectionConfig, }) ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **context** (BuildContext) - Required - The build context for the widget. - **arViewCreatedCallback** (ARViewCreatedCallback) - Required - A callback function that is invoked when the AR view is successfully created. - **planeDetectionConfig** (PlaneDetectionConfig) - Required - Configuration object for enabling and customizing plane detection. ``` -------------------------------- ### ARView Build Method Implementation Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/IosARView/build.html This method is responsible for building the ARView widget. It sets up the necessary parameters and creates a UiKitView to interface with the native AR view on the platform. The `onPlatformViewCreated` callback is used to register the view on the platform side. ```dart @override Widget build( {BuildContext? context, ARViewCreatedCallback? arViewCreatedCallback, PlaneDetectionConfig? planeDetectionConfig}) { _context = context; _arViewCreatedCallback = arViewCreatedCallback; _planeDetectionConfig = planeDetectionConfig; // This is used in the platform side to register the view. final String viewType = 'ar_flutter_plugin'; // Pass parameters to the platform side. final Map creationParams = {}; return UiKitView( viewType: viewType, layoutDirection: TextDirection.ltr, creationParams: creationParams, creationParamsCodec: const StandardMessageCodec(), onPlatformViewCreated: onPlatformViewCreated, ); } ``` -------------------------------- ### openLocationServicesSettings() Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager-class.html Opens the device's location services settings. ```APIDOC ## openLocationServicesSettings() ### Description Opens the device's system settings screen where users can enable or disable location services. ### Method `openLocationServicesSettings()` ### Returns - `void` ``` -------------------------------- ### Get Last Known Position with Permission Checks Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager/getLastKnownPosition.html This method retrieves the last known location of the device. It first checks if location services are enabled and then verifies or requests location permissions. If permissions are denied permanently, it returns an error. ```dart Future getLastKnownPosition() async { bool serviceEnabled; LocationPermission permission; // Test if location services are enabled. serviceEnabled = await Geolocator.isLocationServiceEnabled(); if (!serviceEnabled) { // Location services are not enabled don't continue // accessing the position and request users of the // App to enable the location services. return Future.error('Location services disabled'); } permission = await Geolocator.checkPermission(); if (permission == LocationPermission.denied) { permission = await Geolocator.requestPermission(); if (permission == LocationPermission.denied) { // Permissions are denied, next time you could try // requesting permissions again (this is also where // Android's shouldShowRequestPermissionRationale // returned true. According to Android guidelines // your App should show an explanatory UI now. return Future.error('Location permissions denied'); } } if (permission == LocationPermission.deniedForever) { // Permissions are denied forever, handle appropriately. return Future.error('Location permissions permanently denied'); } // When we reach here, permissions are granted and we can // continue accessing the last known position of the device. return await Geolocator.getLastKnownPosition(); } ``` -------------------------------- ### ARPlaneAnchor Methods Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_anchor/ARPlaneAnchor-class.html Methods available for ARPlaneAnchor instances. ```APIDOC ## ARPlaneAnchor Methods ### toJson - **Description**: Serializes an ARAnchor to a Map. - **Returns**: Map - **Override**: Overrides the inherited method. ### toString - **Description**: Returns a string representation of this object. - **Returns**: String - **Inherited**: Inherited from Object. ``` -------------------------------- ### ARPlaneAnchor Constructor Implementation Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_anchor/ARPlaneAnchor/ARPlaneAnchor.html Initializes an ARPlaneAnchor with transformation, name, child nodes, cloud anchor ID, and time-to-live. Defaults are provided for optional parameters. ```dart ARPlaneAnchor({ required Matrix4 transformation, String? name, List? childNodes, String? cloudanchorid, int? ttl, }) : childNodes = childNodes ?? [], cloudanchorid = cloudanchorid ?? null, ttl = ttl ?? 1, super( type: AnchorType.plane, transformation: transformation, name: name); ``` -------------------------------- ### platformVersion Source: https://pub.dev/documentation/ar_flutter_plugin/latest/ar_flutter_plugin/ArFlutterPlugin/platformVersion.html A Future property that returns the version of the platform the plugin is running on. ```APIDOC ## platformVersion ### Description Retrieves the version of the underlying platform. ### Method Signature Future get platformVersion ### Implementation Details This method internally invokes a platform channel method named 'getPlatformVersion' to fetch the version string. ``` -------------------------------- ### PlatformARView Constructor Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/PlatformARView/PlatformARView.html Creates a new PlatformARView instance. It selects the appropriate AR view implementation based on the target platform. ```APIDOC ## PlatformARView Constructor ### Description This is a factory constructor for `PlatformARView`. It takes a `TargetPlatform` as input and returns an instance of either `AndroidARView` or `IosARView` based on the platform. ### Parameters #### Path Parameters - **platform** (TargetPlatform) - Required - The target platform for which to create the AR view. ### Implementation Details ```dart factory PlatformARView(TargetPlatform platform) { switch (platform) { case TargetPlatform.android: return AndroidARView(); case TargetPlatform.iOS: return IosARView(); default: throw FlutterError('Unsupported platform'); } } ``` ``` -------------------------------- ### Configure iOS Podfile for Permissions Source: https://pub.dev/documentation/ar_flutter_plugin/latest/index.html Modify the iOS Podfile to grant necessary permissions (camera, photos, location, sensors, Bluetooth) for the AR plugin. ```ruby post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| # Additional configuration options could already be set here # BEGINNING OF WHAT YOU SHOULD ADD config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ '$(inherited)', ## dart: PermissionGroup.camera 'PERMISSION_CAMERA=1', ## dart: PermissionGroup.photos 'PERMISSION_PHOTOS=1', ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] 'PERMISSION_LOCATION=1', ## dart: PermissionGroup.sensors 'PERMISSION_SENSORS=1', ## dart: PermissionGroup.bluetooth 'PERMISSION_BLUETOOTH=1', # add additional permission groups if required ] # END OF WHAT YOU SHOULD ADD end end end ``` -------------------------------- ### initGoogleCloudAnchorMode Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_anchor_manager/ARAnchorManager/initGoogleCloudAnchorMode.html Activates collaborative AR mode using Google Cloud Anchors. This method should be called to enable features that rely on shared AR experiences across devices. ```APIDOC ## initGoogleCloudAnchorMode() ### Description Activates collaborative AR mode (using Google Cloud Anchors). ### Method Signature dynamic initGoogleCloudAnchorMode() ### Implementation Details This method internally invokes a platform channel method named 'initGoogleCloudAnchorMode' with an empty parameter map. ``` -------------------------------- ### ARNode Static Methods Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode-class.html Provides static methods for creating ARNode instances. ```APIDOC ## ARNode Static Methods ### Description Provides static methods for creating ARNode instances. ### Static Methods - **fromMap(Map map)** - Creates an ARNode from a map. ``` -------------------------------- ### build method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/AndroidARView/build.html The build method is an override that constructs the AR View widget. It accepts optional parameters for context, a callback when the AR view is created, and plane detection configuration. ```APIDOC ## build method ### Description This method overrides the base build method to construct the AR View widget. It allows for passing context, a callback for when the AR view is created, and configuration for plane detection. ### Method Signature ```dart Widget build({ BuildContext? context, ARViewCreatedCallback? arViewCreatedCallback, PlaneDetectionConfig? planeDetectionConfig, }) ``` ### Parameters - **context** (BuildContext?) - The build context for the widget. - **arViewCreatedCallback** (ARViewCreatedCallback?) - A callback function that is invoked when the AR view is successfully created. - **planeDetectionConfig** (PlaneDetectionConfig?) - Configuration for plane detection within the AR view. ### Implementation Details The implementation involves setting up internal variables and creating an `AndroidView` widget. This `AndroidView` is configured with a specific `viewType` ('ar_flutter_plugin') and passes creation parameters to the platform side. The `onPlatformViewCreated` callback is also specified. ``` -------------------------------- ### openAppPermissionSettings Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager/openAppPermissionSettings.html Opens the settings of the current application, allowing users to grant or deny location permissions. ```APIDOC ## openAppPermissionSettings() ### Description Opens the settings of the current application. ### Method ```dart void openAppPermissionSettings() ``` ### Implementation ```dart void openAppPermissionSettings() async { await Geolocator.openAppSettings(); } ``` ``` -------------------------------- ### ARNode Constructor Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode-class.html Initializes a new ARNode with specified type, URI, and optional transform properties. ```APIDOC ## ARNode Constructor ### Description Initializes a new ARNode with specified type, URI, and optional transform properties. ### Parameters - **type** (NodeType) - Required - The type of the node. - **uri** (String) - Required - The path or URL to the 3D model. - **name** (String?) - Optional - The name of the node. - **position** (Vector3?) - Optional - The position of the node. - **scale** (Vector3?) - Optional - The scale of the node. - **rotation** (Vector4?) - Optional - The rotation of the node. - **eulerAngles** (Vector3?) - Optional - The Euler angles of the node. - **transformation** (Matrix4?) - Optional - The transformation matrix of the node. - **data** (Map?) - Optional - Additional data attached to the node. ``` -------------------------------- ### Implement onPlatformViewCreated Method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/PlatformARView/onPlatformViewCreated.html This is the abstract method signature for onPlatformViewCreated. Implement this method to handle actions when the platform view is created. ```dart void onPlatformViewCreated(int id); ``` -------------------------------- ### onPlatformViewCreated Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/PlatformARView/onPlatformViewCreated.html Callback function that is executed once the view is established. ```APIDOC ## onPlatformViewCreated abstract method ### Description Callback function that is executed once the view is established. ### Signature ```dart void onPlatformViewCreated(int id); ``` ### Parameters #### Path Parameters - **id** (int) - The unique identifier for the platform view. ``` -------------------------------- ### Download Anchor Implementation Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_anchor_manager/ARAnchorManager/downloadAnchor.html Implement the downloadAnchor method to retrieve an anchor from the Google Cloud Anchor API using its ID. This method is asynchronous and returns a boolean indicating success. ```dart Future downloadAnchor(String cloudanchorid) async { print("TRYING TO DOWNLOAD ANCHOR WITH ID " + cloudanchorid); _channel .invokeMethod('downloadAnchor', {"cloudanchorid": cloudanchorid}); } ``` -------------------------------- ### ARView createState Implementation with Parameters Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/ARView/createState.html This implementation of createState for _ARViewState initializes the state with specific parameters passed from the widget. ```dart @override _ARViewState createState() => _ARViewState( showPlatformType: this.showPlatformType, permissionPromptDescription: this.permissionPromptDescription, permissionPromptButtonText: this.permissionPromptButtonText, permissionPromptParentalRestriction: this.permissionPromptParentalRestriction); ``` -------------------------------- ### fromJson static method Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_hittest_result/ARHitTestResult/fromJson.html Instantiates an ARHitTestResult from a serialized ARHitTestResult JSON map. ```APIDOC ## fromJson static method ### Description Instantiates an ARHitTestResult from a serialized ARHitTestResult. ### Method Signature `static ARHitTestResult fromJson(Map json)` ### Parameters #### Path Parameters - **json** (Map) - Required - A map representing the serialized ARHitTestResult. ### Implementation ```dart static ARHitTestResult fromJson(Map json) => _$ARHitTestResultFromJson(json); ``` ``` -------------------------------- ### ARNode Constructor Source: https://pub.dev/documentation/ar_flutter_plugin/latest/models_ar_node/ARNode/ARNode.html Initializes a new ARNode with specified properties. The constructor takes required type and uri, along with optional parameters for name, position, scale, rotation, eulerAngles, transformation, and data. ```APIDOC ## ARNode Constructor ### Description Initializes a new ARNode with specified properties. The constructor takes required type and uri, along with optional parameters for name, position, scale, rotation, eulerAngles, transformation, and data. ### Parameters #### Constructor Parameters - **type** (NodeType) - Required - The type of the AR node. - **uri** (String) - Required - The URI associated with the AR node. - **name** (String?) - Optional - The name of the AR node. - **position** (Vector3?) - Optional - The position of the AR node in 3D space. - **scale** (Vector3?) - Optional - The scale of the AR node. - **rotation** (Vector4?) - Optional - The rotation of the AR node. - **eulerAngles** (Vector3?) - Optional - The Euler angles for the AR node's rotation. - **transformation** (Matrix4?) - Optional - The transformation matrix for the AR node. - **data** (Map?) - Optional - Additional data associated with the AR node. ### Implementation Details The constructor assigns the provided parameters to the ARNode instance. If a name is not provided, a unique key is generated. The transformation matrix is created based on the provided transformation or other positional/rotational parameters. Any additional data is also stored. ``` -------------------------------- ### PlatformARView Build Method Signature Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/PlatformARView/build.html This is the abstract method signature for building the AR view. Subclasses must implement this method. ```dart Widget build({ @required BuildContext context, @required ARViewCreatedCallback arViewCreatedCallback, @required PlaneDetectionConfig planeDetectionConfig, }); ``` -------------------------------- ### IosARView Methods Source: https://pub.dev/documentation/ar_flutter_plugin/latest/widgets_ar_view/IosARView-class.html Provides methods for interacting with the AR view on iOS. ```APIDOC ## build() ### Description Builds the AR view widget. ### Method build({BuildContext? context, ARViewCreatedCallback? arViewCreatedCallback, PlaneDetectionConfig? planeDetectionConfig}) ### Parameters - **context** (BuildContext?) - Optional - The build context. - **arViewCreatedCallback** (ARViewCreatedCallback?) - Optional - Callback function when the AR view is created. - **planeDetectionConfig** (PlaneDetectionConfig?) - Optional - Configuration for plane detection. ``` ```APIDOC ## onPlatformViewCreated() ### Description Callback function that is executed once the view is established. ### Method onPlatformViewCreated(int id) ### Parameters - **id** (int) - The ID of the platform view. ``` -------------------------------- ### openLocationServicesSettings Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager/openLocationServicesSettings.html Opens the device settings where location services can be enabled. ```APIDOC ## openLocationServicesSettings() ### Description Opens the device settings where location services can be enabled. ### Method Signature `void openLocationServicesSettings()` ### Usage Example ```dart ARLocationManager.openLocationServicesSettings(); ``` ``` -------------------------------- ### ARLocationManager Constructor Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_location_manager/ARLocationManager/ARLocationManager.html Initializes a new instance of the ARLocationManager class. ```APIDOC ## ARLocationManager() ### Description Creates a new ARLocationManager instance. ### Method Constructor ### Endpoint N/A ### Parameters None ### Request Example ```dart final arLocationManager = ARLocationManager(); ``` ### Response #### Success Response An instance of ARLocationManager. #### Response Example ```dart Instance of 'ARLocationManager' ``` ``` -------------------------------- ### ARAnchorManager Constructors Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_anchor_manager/ARAnchorManager-class.html Initializes a new instance of the ARAnchorManager class. ```APIDOC ## ARAnchorManager(int id, {bool debug = false}) ### Description Initializes a new instance of the ARAnchorManager class. ### Parameters - **id** (int) - Required - Identifier for the anchor manager. - **debug** (bool) - Optional - Debugging status flag. Defaults to false. ``` -------------------------------- ### ARObjectManager Constructor Source: https://pub.dev/documentation/ar_flutter_plugin/latest/managers_ar_object_manager/ARObjectManager-class.html Initializes a new instance of the ARObjectManager class. ```APIDOC ## ARObjectManager Constructor ### Description Initializes a new instance of the ARObjectManager class. ### Parameters - **id** (int) - Required - The identifier for the AR view. - **debug** (bool) - Optional - If true, all platform calls are printed. Defaults to false. ```