initializeReader method

Future<bool> initializeReader(
  1. InitConfig config,
  2. SuccessCompletion? successCompletion
)

Allows you to initialize Document Reader.

config A configuration file for DocumentReader initialization.

successCompletion The block to execute after the initialization finishes.

Note: for convinience function returns Future<bool>. This is the same bool that is returned by SuccessCompletion, indicating whether the function has succeeded or not. If you don't need to handle an error, you can leave successCompletion as null and only use the return value of the function.

Implementation

Future<bool> initializeReader(
  InitConfig config,
  SuccessCompletion? successCompletion,
) async {
  var funcName = "initializeReader";
  if (config.license == null)
    funcName = "initializeReaderWithBleDeviceConfig";

  bool success = _successCompletionFromJson(
    await _bridge.invokeMethod(funcName, [config.toJson()]),
    successCompletion,
  );

  await _onInit(success);

  return success;
}