scanFromImage method
Scans QR/Barcode from an image file
Implementation
@override
Future<List<QrScanResult>> scanFromImage(
String imagePath,
ScanOptions options,
) async {
try {
final results = await methodChannel.invokeMethod<List<dynamic>>(
'scanFromImage',
{'imagePath': imagePath, ...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);
}
}