ready static method

Future<bool> ready(
  1. String key,
  2. bool showBadge
)

This method should be called before calling execute() method.

Implementation

static Future<bool> ready(String key, bool showBadge) async {
  if (!kIsWeb) return false;
  try {
    _gRecaptchaV3Key = key;
    await _ready(allowInterop(() {
      debugPrint('gRecaptcha V3 ready');
      changeVisibility(showBadge);
    }));
    return true;
  } catch (e) {
    debugPrint("Error: Looks like reCaptcha js is not loaded yet."
        "Try to add the recaptcha js to your html <head> tag (or before flutter.js).");
    debugPrint(e.toString());
    return false;
  }
}