universal_barcode_scanner library

Barcode and QR code scanner for Flutter, on Android, iOS, Linux, macOS, web and Windows.

One entry point, UniversalBarcodeScanner. Use its static UniversalBarcodeScanner.scan to open the scanner as a route and get a code back, UniversalBarcodeScanner.stream to keep reading, or the widget itself to embed the camera in your own layout on Android and iOS.

final String? code = await UniversalBarcodeScanner.scan(context);

Classes

ContactContent
A person or a business, from a vCard or a MECARD.
EmailContent
An e-mail to write.
EventContent
An event for the calendar, from an iCalendar VEVENT.
GeoContent
A place on the map.
PhoneContent
A phone number to call.
ScanContent
What the text of a code means, where it follows a format phones know: a link, a Wi-Fi network, a contact, an e-mail, a phone number, a text message, a place or an event.
ScanFrame
A frame of the camera, in grey: what the scan window shows, for an app that reads the picture itself, such as the text of a document.
ScannerBar
A bar above the web, Windows and Linux scanner: a title, and a back button.
ScannerButtonStyle
How the buttons over the camera look: the group asked for with buttons, and the close button of a scanner with no bar.
ScannerController
Drives an embedded scanner: torch, pause, resume, zoom.
ScannerLabels
The words the scanner shows or says: its buttons, for screen readers, what the web, Windows and Linux page writes when the camera will not start, and what it says of a code the validator refuses.
ScanResult
A code read: its text, and the symbology it was printed in.
SmsContent
A text message to send.
UniversalBarcodeScanner
UrlContent
A web address.
WifiContent
A Wi-Fi network to join.

Enums

BarcodeFormat
The symbology of a code read.
CameraFace
Which camera to open.
ScanFormat
Which symbologies the scanner accepts, on every platform.
ScannerButton
A button over the camera, drawn by Flutter wherever the scanner is a Flutter page or view.
ScannerErrorCode
Why the scanner could not open or had to stop.
ScanWindow
Shape of the scan window.
WifiSecurity
How a Wi-Fi network is secured.

Typedefs

ScannerCreatedCallback = void Function(ScannerController controller)
Called once the embedded scanner exists, with the controller that drives it.
ScanValidator = bool Function(ScanResult result)
Barcode and QR code scanner.

Exceptions / Errors

ScannerException
Thrown by UniversalBarcodeScanner.scan, emitted on the stream of UniversalBarcodeScanner.stream, and handed to the embedded view's onError, when the scanner cannot do its job.