Repository no longer maintained, please switch to official plugin from Scandit.
- Documentation: https://docs.scandit.com/data-capture-sdk/flutter/
- Pub.dev: https://pub.dev/publishers/scandit.com/packages
- GitHub: https://github.com/Scandit/datacapture-flutter-samples
Scandit mobile computer vision software brings unrivaled scanning performance to any app on any smart device, turning it into a powerful data-capture tool.
Add the following to the ios/Runner/Info.plist:
- The key
Privacy - Camera Usage Descriptionand a usage description.
Or in text format add the key:
<key>NSCameraUsageDescription</key>
<string>Can I use the camera for scanning?</string>Min target is iOS 9.0
Min SDK version should be 19 or later
minSdkVersion 19
First, we need to do add flutter_scandit_plugin to the dependencies of the pubspec.yaml
dependencies:
flutter_scandit_plugin: anyNext, we need to install it:
# Dart
pub get
# Flutter
flutter packages getAdd Scandit widget to the tree
import 'package:flutter_scandit_plugin/flutter_scandit_plugin.dart';
ScanditController? _controller;
Scandit(
scanned: (result) {
// handle scanned result here
},
onError: (e) {
// handle errors here
},
onScanditCreated: (controller) => _controller = controller,
licenseKey: '', // 'INSERT YOUR TEST KEY'
)
After a successful scan you need to manually resume scanning if needed:
_controller?.resumeBarcodeScanning()Please check example folder and do not forget to add Scandit Key to main.dart
