-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
The current version of the buildView method in Google Maps' platform interface is completely oriented towards the Method Channel implementation (there are other examples, but this is the worst offender).
The core plugin eagerly transforms everything into a JSON-ifiable object (Map<String, dynamic>) here:
This causes problems in the web implementation, that normally needs one extra step to undo that transformation so it can operate with less stringly typed data structures.
Another problem of this, is that Controller methods operate with the normal data structures until it's strictly necessary to convert them, so any fixes in Web need to verify the "initial geometry case" (handling the early serialization), and the "controller injected changes" (which don't serialize and handle the proper data structures).
Proposal
- Introduce a new
buildViewplatform method that uses semantic parameters and proper types (the same as the Controller methods) - Keep the supplied types for as long as possible, and convert those ".toJson" only when doing a MethodChannel call.
- Remove all the code required to handle the early serialization from the interface and the web implementation.
This would allow web to remove a good chunk of this file, which deals with converting rawOptions to proper types again.