cwflutter 1.0.8
cwflutter: ^1.0.8

Flutter Android iOS

A plugin that implements the ConfigWise SDK to have AR capability with a flutter app.

cwflutter #

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

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

To use this plugin, add cwflutter as a dependency in your pubspec.yaml file.

Get the COMPANY_AUTH_TOKEN Credentials for your AR project. For more details go to https://docs.configwise.io/api/setup-authentication-token//

Import package:cwflutter/cwflutter.dart, and initiate Cwflutter Plugin with your credentials.

Integration #

    try {
      await Cwflutter.initialize("YOUR_COMPANY_AUTH_TOKEN");
    } on PlatformException catch (e) {
      print('Failed to initialize ConfigWise SDK due error: ${error.message}');
    }

    try {
      await Cwflutter.signIn();
    } on PlatformException catch (e) {
      print('Unable to pass authorization due error: ${error.message}');
    }

NOTICE: See examples (how to initialize and pass authorization) in our example project - see _initConfigWiseSdk() function in the example/lib/main.dart

Usage #

We highly recommend to use our example project (code) to get first experience. See: example/lib/main.dart

Depend on it #

Follow the installation instructions from Dart Packages site.

Update Info.plist #

The plugin use native view from ARKit, which is not yet supported by default. To make it work add the following code to Info.plist:

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

ARKit uses the device camera, so do not forget to provide the NSCameraUsageDescription. You may specify it in Info.plist like that:

    <key>NSCameraUsageDescription</key>
    <string>Describe why your app needs AR here.</string>

Let's add Metal (shader rendering) code to ios Runner in your Flutter project. #

Finally, add NodeRender.metal file (as metal source code) to ios Runner in your Flutter project. NodeRender.metal is Apple Metal API based code to show 'glow' visualisation of highlighted 3D objects in the AR scene. Unfortunately, there are some known issues (restrictions) to pack .metal code inside of ConfigWiseSDK framework - that's why .metal code must be part of your project to pass compilation steps.

0
likes
80
pub points
38%
popularity

A plugin that implements the ConfigWise SDK to have AR capability with a flutter app.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

support@configwise.io

License

Apache 2.0 (LICENSE)

Dependencies

flutter, json_annotation, vector_math

More

Packages that depend on cwflutter