loadJs function

Future<void> loadJs()

Implementation

Future<void> loadJs() async {
  if (context['surveyjs'] != null) {
    //loaded
    return;
  }
  //https://github.com/flutter/flutter/issues/126713#issuecomment-1548025818
  // Fix Require.js issues with Flutter overrides
  try {
    context.callMethod('fixRequireJs', []);
  } catch (e) {
    //
  }

  return injectSrcScript(
    "assets/packages/flutter_survey_js_expression/assets/index.js",
    'surveyjs',
  );
}