fetchAndExecuteJavaScript function

Future<void> fetchAndExecuteJavaScript(
  1. dynamic env
)

Implementation

Future<void> fetchAndExecuteJavaScript(env) async {
  String url = 'https://fingerprint.app.bureau.id/index.js';
  if (env == 'SANDBOX') {
    url = 'https://fingerprint.app.stg.bureau.id/index.js';
  }

  try {
    ScriptElement script = ScriptElement();
    script.src = url;
    document.body?.append(script);
  } catch (e) {
    if (kDebugMode) {
      print('Error fetching or executing JavaScript: $e');
    }
  }
}