Skip to content

Conversation

@Rexios80
Copy link
Contributor

@Rexios80 Rexios80 commented Jul 8, 2024

No description provided.

@Rexios80 Rexios80 changed the title Add missing getters to new js interop Fix issues with new js interop Jul 8, 2024
@Rexios80
Copy link
Contributor Author

Rexios80 commented Jul 8, 2024

There must still be an issue with the function getters but I'm not sure what. This exception seems to be internal to the Google Maps code. Do you have any ideas?

 ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
 The following JSNoSuchMethodError was thrown running a test:
 TypeError: Cannot read properties of undefined (reading 'x')
 
 When the exception was thrown, this was the stack:
 https://maps.googleapis.com/maps/api/js?key=AIzaSyAa9cRBkhuxGq3Xw3HPz8SPwaVOhRmm7kk&libraries=geometry 363:449  fromLatLngToPoint
 packages/google_maps/src/generated/image_overlay/projection.dart 26:18                                          <fn>
 packages/google_maps_flutter_web/src/third_party/to_screen_location/to_screen_location.dart 44:42               toScreenLocation
 packages/google_maps_flutter_web/src/google_maps_controller.dart 406:9                                          getScreenCoordinate
 dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                                              runBody
 dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5                                              _async
 packages/google_maps_flutter_web/src/google_maps_controller.dart 401:47                                         getScreenCoordinate
 packages/google_maps_flutter_web/src/google_maps_flutter_web.dart 163:22                                        getScreenCoordinate
 packages/google_maps_flutter/src/controller.dart 216:10                                                         getScreenCoordinate
 projection_test.dart 147:29                                                                                     <fn>
 dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                                              <fn>
 dart-sdk/lib/async/zone.dart 1407:47                                                                            _rootRunUnary
 dart-sdk/lib/async/zone.dart 1308:19                                                                            runUnary
 dart-sdk/lib/async/future_impl.dart 163:18                                                                      handleValue
 dart-sdk/lib/async/future_impl.dart 861:44                                                                      handleValueCallback
 dart-sdk/lib/async/future_impl.dart 890:13                                                                      _propagateToListeners
 dart-sdk/lib/async/future_impl.dart 666:5                                                                       [_completeWithValue]
 dart-sdk/lib/async/future_impl.dart 736:7                                                                       <fn>
 dart-sdk/lib/async/zone.dart 1399:13                                                                            _rootRun
 dart-sdk/lib/async/zone.dart 1301:19                                                                            run
 dart-sdk/lib/async/zone.dart 1209:7                                                                             runGuarded
 dart-sdk/lib/async/zone.dart 1249:23                                                                            callback
 dart-sdk/lib/async/schedule_microtask.dart 40:11                                                                _microtaskLoop
 dart-sdk/lib/async/schedule_microtask.dart 49:5                                                                 _startMicrotaskLoop
 dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7                                              <fn>
 
 The test description was:
   target of map is in center of widget
 ════════════════════════════════════════════════════════════════════════════════════════════════════

@a14n a14n merged commit 1216e03 into a14n:new-js-interop Jul 9, 2024
@a14n
Copy link
Owner

a14n commented Jul 9, 2024

Thanks for your contribution.

In all examples I never saw any explicit call of the function getter you added. Those functions are usually intended to be implemented for custom usage.

Regarding the issue you faced I will try another pattern and see if it works.

@a14n
Copy link
Owner

a14n commented Jul 9, 2024

I refactored how getters of function are implemented in 5972ce5. I made a quick test that looks good. Could you try it on your Flutter PR? If it's ok I'll publish a new dev version.

@Rexios80
Copy link
Contributor Author

Rexios80 commented Jul 9, 2024

Unfortunately I get the same issue. I would say it's an issue with the test but it definitely works with the old google_maps version.

@Rexios80
Copy link
Contributor Author

Rexios80 commented Jul 9, 2024

I created #133 to track this

auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 31, 2024
dko5ki23t pushed a commit to dko5ki23t/google_maps_flutter_improved that referenced this pull request May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants