Open Camera #
Open Camera is a flutter plugin, very light, nice and intuitive, which adds to your application the ability to take photos and record videos.
Get started #
It is very easy to use the plugin Open Camera in your project, it was thought to be like this ;)
For Android systems the minimum version of SDK is 24 and IOS minimum version is 10.0.
Installing the plugin in your application is very simple, add in your file pubspec.yaml the plugin reference OpenCamera.
dependencies: open_camera: ... flutter: sdk: flutter
In the AndroidManifest.xml file add the following permissions.
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.CAMERA" android:required="true" /> <uses-permission android:name="android.permission.RECORD_AUDIO" android:required="true" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:required="true" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:required="true" />
In IOS it is necessary to edit the following files.
Change the line by uncommenting and changing the minimum version in the ios/PodFile.
platform :ios, '10.0'
In the Info.plist file add the following permissions.
<key>NSCameraUsageDescription</key> <string>Can I use the camera please?</string> <key>NSMicrophoneUsageDescription</key> <string>Can I use the mic please?</string> <key>NSPhotoLibraryAddUsageDescription</key> <string>Camera App would like to save photos from the app to your gallery</string> <key>NSPhotoLibraryUsageDescription</key> <string>Camera App would like to access your photo gallery for uploading images to the app</string> <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
How to use #
var settings = CameraSettings( limitRecord: 15, useCompression: true, resolutionPreset: ResolutionPreset.ultraHigh );
|limitRecord||int||Recording time limit in seconds.|
|useCompression||bool||Whether the plugin should compress the photo or video before returning|
|resolutionPreset||enum||Camera resolution quality|
Taking a picture #
File file = await openCamera( context, CameraMode.Photo, cameraSettings: CameraSettings( useCompression: true, resolutionPreset: ResolutionPreset.ultraHigh, ), );
Recording a video #
File file = await openCamera(context, CameraMode.Video, cameraSettings: CameraSettings( limitRecord: 15, useCompression: true, resolutionPreset: ResolutionPreset.ultraHigh, ), );
Diogo Luiz Ponce (email@example.com) / Joelson Santos Cunha (firstname.lastname@example.org)
- Created image compression system
- Dependency compatibility adjustments.
Demonstrates how to use the open_camera plugin.
Getting Started #
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: open_camera: ^0.0.5
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Dec 10, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.1
- pana: 0.13.1+4
- Flutter: 1.12.13+hotfix.2
Maintenance issues and suggestions
Support latest dependencies. (-30 points)
The version constraint in
pubspec.yaml does not support the latest published versions for 3 dependencies (
Package is pre-v0.1 release. (-10 points)
While nothing is inherently wrong with versions of
0.0.*, it might mean that the author is still experimenting with the general direction of the API.
|Dart SDK||>=2.2.0 <3.0.0|