recognizeText method

  1. @override
Future<String> recognizeText(
  1. String imagePath
)
override

Implementation

@override
Future<String> recognizeText(String imagePath) async {
  if (!Platform.isIOS && !Platform.isAndroid) {
    throw UnsupportedError(
        'FlutterNativeOcr is only available on iOS and Android.');
  }

  final result = await methodChannel.invokeMethod<String>('recognizeText', {
    'imagePath': imagePath,
  });

  return result ?? '';
}