startFinderDocumentScanner static method

  1. @Deprecated('Use ScanbotSdkUiV2.startFinderDocumentScanner instead.')
Future<FinderDocumentScanningResult> startFinderDocumentScanner(
  1. FinderDocumentScannerConfiguration config
)

Implementation

@Deprecated('Use ScanbotSdkUiV2.startFinderDocumentScanner instead.')
static Future<FinderDocumentScanningResult> startFinderDocumentScanner(
    FinderDocumentScannerConfiguration config) async {
  try {
    var updatedParameters = config.toJson();
    const defaultJsonName = "FinderDocumentScreen";
    var configuration = await SharedCalls.applyParametersOnDefaultJson(
        defaultJsonName, updatedParameters);

    var result = await SharedCalls.invoke(
        _channel, 'startFinderDocumentScanner', configuration);
    if (SharedCalls.wasCanceled(result)) {
      return FinderDocumentScanningResult.canceled();
    }
    return FinderDocumentScanningResult.fromJson(jsonDecode(result));
  } catch (e) {
    Logger.root.severe(e);
    return FinderDocumentScanningResult.error(e.toString());
  }
}