Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

314
Views
how to send multi `windows.postmessage(data)` to a single source, with adding an ID to every message to be able to catch it

I need to send more than one message using js to the same source flutter app is the source and it is ready to receive all messages based on their ID , which is mentioned in documentations to be sent like this :

measurePointTwo.postMessage(ptTwoData)

this causes the error :

Uncaught ReferenceError: measurePointTwo is not defined

That is because am using measurePointTwo and I cant not use this because this is how the listener in my flutter app is getting different messages, based on this ID or unique name.

What I have tried

window.measurePointTwo.postMessage(ptTwoData)

and this is getting me this error :

Uncaught TypeError: Cannot read properties of undefined (reading 'postMessage')

Extra info

  • This window runs in my flutter app is a Web view
  • Inside the WebView this function is used to handle postMessage :
                            javascriptChannels: {
                              JavascriptChannel(
                                  name: 'newCords',
                                  onMessageReceived:
                                      (JavascriptMessage message) {
                                    controller.getLagLngFromJSMessage(
                                        message.message);
                                  }),
                              JavascriptChannel(
                                  name: 'measurePointOne',
                                  onMessageReceived:
                                      (JavascriptMessage message) {
                                    controller.getPintOneFromJSMessage(
                                        message.message);
                                  }),
                              JavascriptChannel(
                                  name: 'measurePointTwo',
                                  onMessageReceived:
                                      (JavascriptMessage message) {
                                    controller.getPintTwoFromJSMessage(
                                        message.message);
                                  }),
                              JavascriptChannel(
                                  name: 'newPoint',
                                  onMessageReceived:
                                      (JavascriptMessage message) {
                                    controller.getClickedPoint(message.message);
                                  }),
                            },

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!