performDirectApiScan method
- BlinkIdSdkSettings blinkidSdkSettings,
- BlinkIdSessionSettings blinkidSessionSettings,
- String firstImage, [
- String? secondImage,
The performDirectApiScan platform channel method launches the BlinkID scanning process inteded for information extraction from static images.
It takes the following parameters: BlinkIdSdkSettings, BlinkIdSessionSettings, firstImage String in the Base64 format and the optional secondImage String in the Base64 format.
-
BlinkID SDK Settings - BlinkIdSdkSettings: 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
-
BlinkID Session Settings - BlinkIdSessionSettings: the class that contains various settings for the scanning session. It contains the settings for the ScanningMode and BlinkIdScanningSettings, which define various parameters that control the scanning process.
-
The
firstImageBase64 string - String: image that represents one side of the document. If the document contains two sides and the ScanningMode is set toautomatic, this should contain the image of the front side of the document. In case the ScanningMode is set tosingle, it can be either the front or the back side of the document. -
The optional
secondImageBase64 string - String: needed if the information from back side of the document is required and the ScanningMode is set toautomatic.
Implementation
@override
Future<BlinkIdScanningResult?> performDirectApiScan(
BlinkIdSdkSettings blinkidSdkSettings,
BlinkIdSessionSettings blinkidSessionSettings,
String firstImage, [
String? secondImage,
]) async {
final jsonBlinkIdDirectApiResult = await methodChannel
.invokeMethod(ARG_SCAN_DIRECT_API_METHOD, {
ARG_BLINKID_SDK_SETTINGS: jsonDecode(jsonEncode(blinkidSdkSettings)),
ARG_SESSION_SETTINGS: jsonDecode(jsonEncode(blinkidSessionSettings)),
ARG_FIRST_IMAGE: jsonDecode(jsonEncode(firstImage)),
ARG_SECOND_IMAGE: jsonDecode(jsonEncode(secondImage)),
});
final decodedMap = Map<String, dynamic>.from(
jsonDecode(jsonBlinkIdDirectApiResult),
);
return BlinkIdScanningResult(decodedMap);
}