onInitialize method

dynamic onInitialize({
  1. bool showAnimatedGuide = true,
  2. bool showFeaturePoints = false,
  3. bool showPlanes = true,
  4. String? customPlaneTexturePath,
  5. bool showWorldOrigin = false,
  6. bool handleTaps = true,
  7. bool handlePans = false,
  8. bool handleRotation = false,
})

Function to initialize the platform-specific AR view. Can be used to initially set or update session settings. customPlaneTexturePath refers to flutter assets from the app that is calling this function, NOT to assets within this plugin. Make sure the assets are correctly registered in the pubspec.yaml of the parent app (e.g. the ./example app in this plugin's repo)

Implementation

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<void>('init', {
    'showAnimatedGuide': showAnimatedGuide,
    'showFeaturePoints': showFeaturePoints,
    'planeDetectionConfig': planeDetectionConfig.index,
    'showPlanes': showPlanes,
    'customPlaneTexturePath': customPlaneTexturePath,
    'showWorldOrigin': showWorldOrigin,
    'handleTaps': handleTaps,
    'handlePans': handlePans,
    'handleRotation': handleRotation,
  });
}