Skip to content

๐Ÿ“ธ Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.

License

Notifications You must be signed in to change notification settings

Apparence-io/CamerAwesome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ApparenceKit Flutter template to bootstrap your next app

This plugin is also available as a template in ApparenceKit.


CamerAwesome

en zh

๐Ÿ“ธ Embedding a camera experience within your own app shouldn't be that hard.
A flutter plugin to integrate awesome Android / iOS camera experience.


This package provides you with a fully customizable camera experience that you can use within your app.
Use our awesome built-in interface or customize it as you want.

Migration guide

If you are migrating from version 1.x.x to 2.x.x, please read the migration guide.

Native features

Here's all native features that cameraAwesome provides to the flutter side.

Features Android iOS
๐Ÿ”– Ask permissions โœ… โœ…
๐ŸŽฅ Record video โœ… โœ…
๐Ÿ“น Multi camera (๐Ÿšง BETA) โœ… โœ…
๐Ÿ”ˆ Enable/disable audio โœ… โœ…
๐ŸŽž Take photos โœ… โœ…
๐ŸŒ† Photo live filters โœ… โœ…
๐ŸŒค Exposure level โœ… โœ…
๐Ÿ“ก Broadcast live image stream โœ… โœ…
๐Ÿงช Image analysis (barcode scan & more.) โœ… โœ…
๐Ÿ‘ Zoom โœ… โœ…
๐Ÿ“ธ Device flash support โœ… โœ…
โŒ›๏ธ Auto focus โœ… โœ…
๐Ÿ“ฒ Live switching camera โœ… โœ…
๐Ÿ˜ตโ€๐Ÿ’ซ Camera rotation stream โœ… โœ…
๐Ÿค Background auto stop โœ… โœ…
๐Ÿ”€ Sensor type switching โ›”๏ธ โœ…
๐Ÿชž Enable/disable front camera mirroring โœ… โœ…

๐Ÿ“–ย  Installation and usage

Add the package in your pubspec.yaml

dependencies:
  camerawesome: ^2.0.0-dev.1
  ...

Platform specific setup

  • iOS

Add these on ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>Your own description</string>

<key>NSMicrophoneUsageDescription</key>
<string>To enable microphone access when recording video</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>To enable GPS location access for Exif data</string>
  • Android

Change the minimum SDK version to 21 (or higher) in android/app/build.gradle:

minSdkVersion 21

In order to be able to take pictures or record videos, you may need additional permissions depending on the Android version and where you want to save them. Read more about it in the official documentation.

WRITE_EXTERNAL_STORAGE is not included in the plugin starting with version 1.4.0.

If you want to record videos with audio, add this permission to your AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.yourpackage">
  <uses-permission android:name="android.permission.RECORD_AUDIO" />

  <!-- Other declarations -->
</manifest>

You may also want to save location of your pictures in exif metadata. In this case, add below permissions:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.yourpackage">
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

  <!-- Other declarations -->
</manifest>
โš ๏ธ Overriding Android dependencies

Some of the dependencies used by CamerAwesome can be overriden if you have a conflict. Change these variables to define which version you want to use:

buildscript {
  ext.kotlin_version = '1.7.10'
  ext {
    // You can override these variables
    compileSdkVersion = 33
    minSdkVersion = 24 // 21 minimum
    playServicesLocationVersion = "20.0.0"
    exifInterfaceVersion = "1.3.4"
  }
  // ...
}

Only change these variables if you are sure of what you are doing.

For example, setting the Play Services Location version might help you when you have conflicts with other plugins. The below line shows an example of these conflicts:

java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.ActivityRecognitionClient, but class was expected

Import the package in your Flutter app

import 'package:camerawesome/camerawesome_plugin.dart';

๐Ÿ‘Œ Awesome built-in interface