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.


Support for iOS > 8.0
Please add as follows in info.plist



minSdkVersion 23

Please add as follows in Manifest.xml

<manifest ... xmlns:tools="">
  <uses-sdk tools:overrideLibrary="" />

Dependent library

iOS: MTBBarcodeScanner
Android: zxing-android-embedded

How to use

View & View Controller

/// Scan Widget
  controller : controller,
  isScanFrame : true, // optional
  scanFrameSize : Size(200, 200), // optional
  frameWidth : 8, // optional
  frameColor : Color(0xcc222222), // optional

/// Widget Controller
controller = CodeScannerController();

How to get scan/read data

How to get scan data

Listen for scanDataStream.

/// scan data

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

/// read data


start scanning (This method is called automatically when CodeScanner is created.)

await controller.startScan();

stop scanning (this method is called on controller dispose method as default.)

await controller.stopScan();

Read code from image gallery

await controller.readDataFromGallery();

Turn on light

await controller.lightON();

Turn off light

await controller.lightOFF();

Toggle light

await controller.toggleLight();