arkit_flutter_plugin

Codemagic build status Awesome Flutter pub package

Note: ARKit is only supported by mobile devices with A9 or later processors (iPhone 6s/7/SE/8/X, iPad 2017/Pro) on iOS 11 and newer.

Usage

Add the following code to Info.plist:

    <key>io.flutter.embedded_views_preview</key>
    <string>YES</string>

Provide the NSCameraUsageDescription.

The simplest code example:

import 'package:arkit_plugin/arkit_position.dart';
import 'package:arkit_plugin/arkit_sphere.dart';
import 'package:flutter/material.dart';
import 'package:arkit_plugin/arkit_plugin.dart';
import 'package:vector_math/vector_math_64.dart';


void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  ARKitController arkitController;

  @override
  void dispose() {
    arkitController?.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) => MaterialApp(
        home: Scaffold(
            appBar: AppBar(
              title: const Text('ARKit in Flutter'),
            ),
            body: Container(
              child: ARKitSceneView(
                showStatistics: true,
                onARKitViewCreated: onARKitViewCreated,
              ),
            )),
      );

  void onARKitViewCreated(ARKitController arkitController) {
    this.arkitController = arkitController;
    this.arkitController.addSphere(ARKitSphere(
          position: Vector3(0, 0, -0.5),
          radius: 0.1,
        ));
  }
}

Result:

flutter

Contributing

If you find a bug or would like to request a new feature, just open an issue. Your contributions are always welcome!

Libraries

arkit_anchor
arkit_arplane_detection
arkit_geometry
arkit_material
arkit_node
arkit_physics_body
arkit_physics_body_type
arkit_physics_shape
arkit_plane
arkit_plugin
arkit_scene_view
arkit_sphere
arkit_text
matrix4_utils
random_string
vector_utils