launchSelphIDCaptureWithConfiguration method

Future<Either<Exception, SelphIdResult>> launchSelphIDCaptureWithConfiguration(
  1. {required String resourcesPath,
  2. required String license,
  3. required SelphIDConfiguration configuration}
)

Implementation

Future<Either<Exception, SelphIdResult>>
    launchSelphIDCaptureWithConfiguration({
  required String resourcesPath,
  required String license,
  required SelphIDConfiguration configuration,
}) async {
  try {
    Map<dynamic, dynamic> resultJson = await SelphidPlugin.startSelphIDWidget(
      operationMode: SelphIDOperation.CAPTURE_WIZARD,
      resourcesPath: resourcesPath,
      widgetLicense: license,
      previousOCRData: '',
      widgetConfigurationJSON: configuration,
    );

    return Right(
      SelphIdResult.fromMap(resultJson),
    );
  } on Exception catch (exception) {
    return Left(
      exception,
    );
  }
}