0

I have below function to return some data to JS side and It's a Map (However the flutter_inappwebview encodes the map after I return It), I do this by addJavaScriptHandler of flutter_inappwebview, But when I return the data I expect the returned object's readValue property is a function but It's not and in JS side the property type is string and I have to use eval of JS to convert this property to function and then use It.

return {
  // Other properties 
  'readValue': '''(async function() {
    var response = await window.myyApp.callHandler('eventName', { 'this': '$uuid' });
    return response;
  })
  ''',
};
}

I am looking for a way to return function in the first place.

2
  • Hey I'm still confused of what you're trying to do here, could you try explaining it in a different way? Commented Sep 23, 2024 at 7:06
  • @Amy I am trying to return a JS object from flutter_inappwebview's addJavaScriptHandler function, But one property of that object is a function, But on JS side when the object is parse is not a function and It's a string and I need to run eval on JS side to make It a function. Commented Sep 24, 2024 at 19:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.