BarcodeScanner Class
BarcodeScanner is the main class of the Ready-to-Use edition of the library and contains the API needed to implement the barcode scanning functionality.
Definition
Assembly: dynamsoft_barcode_reader_bundle_flutter
class BarcodeScanner
Constructor
BarcodeScanner.new()
Methods
launch
This function initiates the barcode scanning process by launching a new page (Activity on Android/ViewController on iOS) that displays the camera stream and any other associated UI elements that help with the scanning process. The launch method accepts an optional BarcodeScannerConfig configuration object that allows the developer to customize the scanner’s behaviour and UI.
Future<BarcodeScanResult> launch(BarcodeScannerConfig config)
Returns
A Future<BarcodeScanResult> that resolves with the BarcodeScanResult when the scanner is closed.
Remarks
Please note that the launch method needs a valid Barcode Reader license in order to operate. You can request a 30-day trial license via the Trial License portal.
Code Snippet
import 'package:dynamsoft_barcode_reader_bundle_flutter/dynamsoft_barcode_reader_bundle_flutter.dart';
void _launchBarcodeScanner() async{
var config = BarcodeScannerConfig(
license: 'YOUR_LICENSE_KEY_HERE',
);
BarcodeScanResult result = await BarcodeScanner.launch(config);
if(result.status == EnumResultStatus.finished){
// handle the result
}
}