processImageFromPath method
Implementation
@override
Future<OcrData?> processImageFromPath([String path = ""]) async {
bool validPath = await File.fromUri(Uri(path: path)).exists();
if(!validPath) throw Exception("Invalid Image Path");
// if(Platform.isAndroid) return null;
String? ocrJson = await methodChannel.invokeMethod<String?>('processImageFromPath', {"path": path});
if (ocrJson == null) return null;
try {
OcrData ocrData = OcrData.fromJson(jsonDecode(ocrJson));
return ocrData;
} catch (e) {
return null;
}
}