recognizeText method

  1. @override
Future<RecognizeResult> recognizeText(
  1. Uint8List imageData
)
override

Implementation

@override
Future<RecognizeResult> recognizeText(Uint8List imageData) =>
    methodChannel.invokeMethod('recognizeText', imageData).then((value) {
      List<Observation>? list;

      if (value is List) {
        list = value.map((e) {
          final map = e as Map;

          return Observation(
              (map['rect'] as List)
                  .map((e) => (e as num).toDouble())
                  .toList(),
              (map['textOptions'] as List).map((e) => e as String).toList());
        }).toList();
      }

      return RecognizeResult(list ?? []);
    });