pickAndOpen static method

Future<ArGlbFile?> pickAndOpen({
  1. required ArTarget target,
  2. double? modelSizeM,
  3. double offsetX = 0,
  4. double? offsetY,
  5. double? offsetZ,
  6. double rotationX = 0,
  7. double rotationY = 0,
  8. double rotationZ = 0,
  9. ArTryOnCamera camera = ArTryOnCamera.rear,
})

Select a local GLB and open the specified target.

Implementation

static Future<ArGlbFile?> pickAndOpen({
  required ArTarget target,
  double? modelSizeM,
  double offsetX = 0,
  double? offsetY,
  double? offsetZ,
  double rotationX = 0,
  double rotationY = 0,
  double rotationZ = 0,
  ArTryOnCamera camera = ArTryOnCamera.rear,
}) async {
  _validate(target, modelSizeM ?? defaultSize(target),
      [offsetX, offsetY ?? 0, offsetZ ?? 0, rotationX, rotationY, rotationZ]);
  final file = await ArGlbPlacement.pickGlb();
  if (file == null) return null;
  await open(modelUri: file.uri, target: target, modelSizeM: modelSizeM,
    offsetX: offsetX, offsetY: offsetY, offsetZ: offsetZ,
    rotationX: rotationX, rotationY: rotationY, rotationZ: rotationZ, camera: camera);
  return file;
}