Package selection guidance compiled from public package information, community data, and project usage.
A Flutter widget that displays a live camera stream and enables real-time machine learning vision features such as barcode, label, text, and face detection. Built for Android and iOS, it integrates seamlessly with Flutter apps to provide on-device image analysis. Ideal for document scanning, object recognition, and automated data entry. The package leverages ML Kit under the hood for accurate and efficient processing.
Use cases
Document scanning
Barcode reading
Text extraction from images
Face detection
Image labeling
Key features
Real-time camera feed
On-device ML processing
Supports multiple vision APIs
Cross-platform (Android & iOS)
Simple integration with Flutter
Low-latency detection
Suitable for
Mobile apps needing OCR
Inventory management tools
Smart document scanners
Face recognition systems
Retail and logistics applications
Considerations
Requires camera permissions
May impact battery life
Performance varies by device
Limited to supported ML vision types
Needs proper handling of async operations
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Flutter Camera Ml Vision
A Flutter package for iOS and Android to show a preview of the camera and detect things with Firebase ML Vision.
Installation
First, add flutter_camera_ml_vision as a dependency.
You must also configure Firebase for each platform project: Android and iOS (see the example folder or https://firebase.google.com/codelabs/firebase-get-to-know-flutter#3 for step by step details).
iOS
Add two rows to the ios/Runner/Info.plist:
one with the key Privacy - Camera Usage Description and a usage description.
and one with the key Privacy - Microphone Usage Description and a usage description.
Or in text format add the key:
<key>NSCameraUsageDescription</key>
<string>Can I use the camera please?</string><key>NSMicrophoneUsageDescription</key><string>Can I use the mic please?</string>
If you're using one of the on-device APIs, include the corresponding ML Kit library model in your Podfile. Then run pod update in a terminal within the same directory as your Podfile.
pod 'Firebase/MLVisionBarcodeModel'
pod 'Firebase/MLVisionFaceModel'
pod 'Firebase/MLVisionLabelModel'
pod 'Firebase/MLVisionTextModel'
Android
Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.
minSdkVersion 21
ps: This is due to the dependency on the camera plugin.
If you're using the on-device LabelDetector, include the latest matching ML Kit: Image Labeling dependency in your app-level build.gradle file.
android {
dependencies {
// ...
api 'com.google.firebase:firebase-ml-vision-image-label-model:19.0.0'
}
}
Optional but recommended: If you use the on-device API, configure your app to automatically download the ML model to the device after your app is installed from the Play Store. To do so, add the following declaration to your app's AndroidManifest.xml file:
<application...>
...
<meta-dataandroid:name="com.google.firebase.ml.vision.DEPENDENCIES"android:value="ocr" /><!-- To use multiple models: android:value="ocr,label,barcode,face" --></application>
CameraMlVision is a widget that shows the preview of the camera. It takes a detector as a parameter here we pass the detectInImage method of the BarcodeDetector object.
The detector parameter can take all the different FirebaseVision Detector. Here is a list :