initializeReader method

Future<SuccessOrError> initializeReader(
  1. InitConfig config
)

Allows you to initialize Document Reader.

config - configuration file for DocumentReader initialization.

Check out SuccessOrError documentation for handling return type.

Implementation

Future<SuccessOrError> initializeReader(InitConfig config) async {
  var funcName = config._useBleDevice
      ? "initializeReaderWithBleDeviceConfig"
      : "initializeReader";

  var response = await _bridge.invokeMethod(funcName, [config.toJson()]);
  var (success, error) = _successOrErrorFromJson(response);
  if (success) await _onInit();

  return (success, error);
}