scanFromBytes method
Scans QR/Barcode from image bytes
Implementation
@override
Future<List<QrScanResult>> scanFromBytes(
Uint8List imageBytes,
ScanOptions options,
) async {
try {
final results = await methodChannel.invokeMethod<List<dynamic>>(
'scanFromBytes',
{'imageBytes': imageBytes, ...options.toJson()},
);
if (results == null) return [];
return results
.map(
(result) =>
QrScanResult.fromJson(Map<String, dynamic>.from(result)),
)
.toList();
} on PlatformException catch (e) {
throw _handlePlatformException(e);
}
}