0 purchases
code scanner
code_scanner #
QR code scanner plugin for flutter. This plugin responds to camera/photo-lirary usage permission requests.
This plugin function is Scan/Read. "Scan" is scanning QR code by scanner, "Read" is reading qr code by picking up qr code image from photo library.
iOS #
Support for iOS > 8.0
Please add as follows in info.plist
<key>NSCameraUsageDescription</key>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string></string>
<key>io.flutter.embedded_views_preview</key>
<true/>
copied to clipboard
Android #
minSdkVersion 23
copied to clipboard
Please add as follows in Manifest.xml
<manifest ... xmlns:tools="http://schemas.android.com/tools">
:
<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />
</manifest>
copied to clipboard
Dependent library #
iOS: MTBBarcodeScanner
Android: zxing-android-embedded
How to use #
View & View Controller #
/// Scan Widget
CodeScanner(
controller : controller,
isScanFrame : true, // optional
scanFrameSize : Size(200, 200), // optional
frameWidth : 8, // optional
frameColor : Color(0xcc222222), // optional
)
/// Widget Controller
controller = CodeScannerController();
copied to clipboard
How to get scan/read data #
How to get scan data #
Listen for scanDataStream.
/// scan data
controller.scanDataStream
copied to clipboard
How to get read data #
If reading qr image from photo gallery is success, true value flows through isSuccessReadDataStream.
If reading qr image from photo gallery is failure, false value flows through isSuccessReadDataStream.
You can detect read result without isSuccessReadDataStream. You Listen for only readDataStream, it is flowed two value pattern, one is actual read data, another is null when reading is failure
/// flag of successful read
controller.isSuccessReadDataStream
/// read data
controller.readDataStream
copied to clipboard
Method #
start scanning (This method is called automatically when CodeScanner is created.)
await controller.startScan();
copied to clipboard
stop scanning (this method is called on controller dispose method as default.)
await controller.stopScan();
copied to clipboard
Read code from image gallery
await controller.readDataFromGallery();
copied to clipboard
Turn on light
await controller.lightON();
copied to clipboard
Turn off light
await controller.lightOFF();
copied to clipboard
Toggle light
await controller.toggleLight();
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.