performScan method

  1. @override
Future<BlinkCardScanningResult?> performScan({
  1. required BlinkCardSdkSettings? blinkCardSdkSettings,
  2. required BlinkCardSessionSettings blinkCardSessionSettings,
  3. ScanningUxSettings? scanningUxSettings,
})
override

The performScan platform channel method launches the BlinkCard scanning process with the default UX properties. It takes the following parameters: BlinkCardSdkSettings, and the optional BlinkCardSessionSettings and ScanningUxSettings classes.

  1. BlinkCard SDK Settings - BlinkCardSdkSettings: the class that contains all of the available SDK settings. It contains settings for the license key, and how the models (that the SDK needs for the scanning process) should be obtained. To obtain a valid license key, please visit https://developer.microblink.com/ or contact us directly at https://help.microblink.com

  2. BlinkCard Session Settings - BlinkCardSessionSettings: the class that contains specific scanning configurations that define how the scanning session should behave. If not used, the default SessionSettings will be applied.

  3. BlinkCard scanning UX settings class - ScanningUxSettings - the class that allows customization of various aspects of the UI & UX used during the scanning process.

Implementation

@override
Future<BlinkCardScanningResult?> performScan({
  required BlinkCardSdkSettings? blinkCardSdkSettings,
  required BlinkCardSessionSettings blinkCardSessionSettings,
  ScanningUxSettings? scanningUxSettings,
}) async {
  final jsonBlinkCardResult = await methodChannel
      .invokeMethod(ARG_PERFORM_SCAN, {
        ARG_BLINKCARD_SDK_SETTINGS: jsonDecode(
          jsonEncode(blinkCardSdkSettings),
        ),
        ARG_BLINKCARD_SESSION_SETTINGS: jsonDecode(
          jsonEncode(blinkCardSessionSettings),
        ),
        ARG_BLINKCARD_SCANNING_UX_SETTINGS: jsonDecode(
          jsonEncode(scanningUxSettings),
        ),
      });
  final decodedNativeBlinkCardResult = Map<String, dynamic>.from(
    jsonDecode(jsonBlinkCardResult),
  );
  return BlinkCardScanningResult(decodedNativeBlinkCardResult);
}