extractDocument method
Extract document information from image bytes
Implementation
@override
Future<Map<String, dynamic>?> extractDocument(Uint8List imageBytes) async {
try {
final result = await methodChannel.invokeMethod<Map<Object?, Object?>>(
'extractDocument',
{'imageBytes': imageBytes},
);
if (result == null) return null;
// Convert the nested Map structure properly
return _convertToStringDynamicMap(result);
} on PlatformException catch (e) {
throw Exception('Failed to extract document: ${e.message}');
}
}