start method

  1. @override
void start({
  1. required String verificationToken,
  2. required VerificationSchemeType verificationScheme,
  3. required String languageCode,
  4. required Function partnerEndCallback,
  5. required Function onVerificationExpired,
  6. required VCheckEnvironment environment,
  7. String? designConfig,
  8. bool? showCloseSDKButton,
  9. String? verificationApiBaseUrl,
  10. String? verificationServiceUrl,
})
override

Implementation

@override
void start({
  required String verificationToken,
  required VerificationSchemeType verificationScheme,
  required String languageCode,
  required Function partnerEndCallback,
  required Function onVerificationExpired,
  required VCheckEnvironment environment,
  String? designConfig,
  bool? showPartnerLogo,
  bool? showCloseSDKButton,
  String? verificationApiBaseUrl,
  String? verificationServiceUrl,
}) async {
  methodChannel.setMethodCallHandler((methodCall) async {
    debugPrint("Caught method call with Dart handler: ${methodCall.method}");
    switch (methodCall.method) {
      case onFinishMethodName:
        Future.delayed(const Duration(milliseconds: 500), () {
          _finishAction!();
        });
        return;
      case onExpiredMethodName:
        Future.delayed(const Duration(milliseconds: 500), () {
          _expiredAction!();
        });
        return;
      default:
        throw MissingPluginException('Not Implemented');
    }
  });

  _finishAction = partnerEndCallback;
  _expiredAction = onVerificationExpired;

  methodChannel.invokeMethod<void>('start', <String, dynamic>{
    'verifToken': verificationToken,
    'verifScheme': verificationScheme.name.toLowerCase(),
    'languageCode': languageCode,
    'environment': environment.name.toLowerCase(),
    'designConfigStr': designConfig,
    'showPartnerLogo': showPartnerLogo ?? false,
    'showCloseSDKButton': showCloseSDKButton ?? true,
    'verificationApiBaseUrl': verificationApiBaseUrl,
    'verificationServiceUrl': verificationServiceUrl,
  });
}