verify static method

Future<bool> verify({
  1. required YidunCaptchaConfig config,
  2. dynamic onReady()?,
  3. dynamic onValidate(
    1. dynamic data
    )?,
  4. dynamic onClose(
    1. dynamic data
    )?,
  5. dynamic onError(
    1. dynamic data
    )?,
})

Implementation

static Future<bool> verify({
  required YidunCaptchaConfig config,
  Function()? onReady,
  Function(dynamic data)? onValidate,
  Function(dynamic data)? onClose,
  Function(dynamic data)? onError,
}) async {
  if (_eventChannelReadied != true) {
    _eventChannel.receiveBroadcastStream().listen(_handleVerifyOnEvent);
    _eventChannelReadied = true;
  }

  _verifyOnReady = onReady;
  _verifyOnValidate = onValidate;
  _verifyOnClose = onClose;
  _verifyOnError = onError;

  return await _methodChannel.invokeMethod('verify', config.toJson());
}