camera_deep_ar 0.0.2+3 icon indicating copy to clipboard operation
camera_deep_ar: ^0.0.2+3 copied to clipboard

A Flutter plugin for Camera video and Photo Augmented reality recording.

camera_deep_ar #

A new Flutter plugin for Camera video and Photo Augmented reality recording. This plug-in requires Android SDK 19+ and iOS 10+

Getting Started #

Get your ApiKeys from DeepAr a link

## Create DeepAr Configuration

DeepArConfig config = DeepArConfig(
// displayMode:,

## Create the controller

final deepArController = CameraDeepArController(config);
String _platformVersion = 'Unknown';
bool isRecording = false;
CameraMode cameraMode = config.cameraMode;
DisplayMode displayMode = config.displayMode;

## Create the controller events listener

deepArController.setEventHandler(DeepArEventHandler(onCameraReady: (v) {
_platformVersion = "onCameraReady $v";
setState(() {});
}, onSnapPhotoCompleted: (v) {
_platformVersion = "onSnapPhotoCompleted $v";
setState(() {});
}, onVideoRecordingComplete: (v) {
_platformVersion = "onVideoRecordingComplete $v";
setState(() {});
}, onSwitchEffect: (v) {
_platformVersion = "onSwitchEffect $v";
setState(() {});

## Create DeepAR Camera preview widget


## Controller Functions

// To take photos

// To start recording

// To switch effects
deepArController.switchEffect(cameraMode, imgPath);

// To stop video recording

Android #

You can use Permission_handler, a permissions plugin for Flutter. Require and add the following permissions in your manifest:

<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Add this to the

-keepclassmembers class { *; }

for release mode modify and add to your BuildType in your build.gradle

buildTypes {
release {
    // TODO: Add your own signing config for the release build.
    // Signing with the debug keys for now, so `flutter run --release` works.
    signingConfig signingConfigs.debug
    proguardFiles getDefaultProguardFile('proguard-android.txt'), ''

iOS #

You only need add the permission message on the Info.plist

<string>Allows you to capture your best moment</string>
<string>Allows you to capture your best moment</string>
<string>Needs access to your mic to help your record voice notes on chat/message conversations</string>