scanWithCamera method

  1. @override
Future<AnalyzerResult?> scanWithCamera(
  1. CaptureSettings captureSettings,
  2. String license
)
override

The scanWithCamera platform channel method launches the Capture process with the default Analyzer & UX properties. It takes the following two parameters: CaptureSettings and a base64 license key String.

  1. Capture Settings: the class that contains all of the available settings for the Capture process. It contains settings for the Capture analyzer, UX and camera configuration settings.

  2. License key string: It should contain a base64 license key bound to the Application ID for Android or Bundle ID for iOS. To obtain a valid license key, please visit https://developer.microblink.com/ or contact us directly at https://help.microblink.com

Implementation

@override
Future<AnalyzerResult?> scanWithCamera(
    CaptureSettings captureSettings, String license) async {
  final jsonAnalyzerResults =
      await methodChannel.invokeMethod(METHOD_SCAN_WITH_CAMERA, {
    ARG_CAPTURE_SETTINGS: jsonDecode(jsonEncode(captureSettings)),
    ARG_LICENSE: {ARG_LICENSE_KEY: license}
  });

  final nativeAnalyzerResult = jsonDecode(jsonAnalyzerResults);
  return AnalyzerResult(Map<String, dynamic>.from(nativeAnalyzerResult));
}