extractDocument method

  1. @override
Future<Map<String, dynamic>?> extractDocument(
  1. Uint8List imageBytes
)
override

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}');
  }
}