startTextDataScanner static method

Future<TextDataScanResult> startTextDataScanner(
  1. TextDataScannerConfiguration config
)

Starts the TextData Scanner UI as full-screen modal UI dialog. The Text Data Scanner is a generic text recognizer and provides the ability to scan small text blocks. The UI contains a configurable finder (frame) within which the text to be scanned can be captured.

Implementation

static Future<TextDataScanResult> startTextDataScanner(
    TextDataScannerConfiguration config) async {
  try {
    var updatedParameters = config.toJson();
    const defaultJsonName = "TextDataScreen";
    var configuration = await SharedCalls.applyParametersOnDefaultJson(
        defaultJsonName, updatedParameters);
    var result = await SharedCalls.invoke(
        _channel, 'startTextDataScanner', configuration);
    if (SharedCalls.wasCanceled(result)) {
      return TextDataScanResult.canceled();
    }
    return TextDataScanResult.fromJson(jsonDecode(result));
  } catch (e) {
    Logger.root.severe(e);
    return TextDataScanResult.error(e.toString());
  }
}