setWebviewConfigs method

dynamic setWebviewConfigs()

Implementation

setWebviewConfigs() {
  controller = WebViewController()
    ..setBackgroundColor(webViewColor ?? Colors.transparent)
    ..setJavaScriptMode(JavaScriptMode.unrestricted)
    ..addJavaScriptChannel(AppConstants.readyJsName,
        onMessageReceived: (JavaScriptMessage message) {})
    ..addJavaScriptChannel(AppConstants.captchaJsName,
        onMessageReceived: (JavaScriptMessage message) {
      onTokenReceived(message.message);
      RecaptchaHandler.instance.updateToken(generatedToken: message.message);

    });

  controller.loadRequest(Uri.parse(url)).then((value) =>
      Future.delayed(const Duration(seconds: 3))
          .then((value) => _initializeReadyJs(controller)));
}