scanBarcode static method
Implementation
static Future<String> scanBarcode(
String lineColor,
String cancelButtonText,
bool isShowFlashIcon,
ScanMode scanMode, {
String? validationPattern,
}) async {
if (lineColor.length != 7 || !lineColor.startsWith("#")) {
throw new FormatException(
"Invalid lineColor format. It should be a valid hex color of the form #RRGGBB.");
}
final String barcodeScanRes = await _channel.invokeMethod('scanBarcode', {
"lineColor": lineColor,
"cancelButtonText": cancelButtonText,
"isShowFlashIcon": isShowFlashIcon,
"scanMode": scanMode.index,
"validationPattern": validationPattern,
});
return barcodeScanRes;
}