Closed domesticmouse closed 1 year ago
Can you elaborate on what this means? I don't see any reference to TargetPlatform
in the web plugin. (I'm not even sure what TargetPlatform
does in a web build...)
Attempting to run the Flutter Google Maps hello world sample on macOS 11.2.3 (20D91) with Chrome 89.0.4389.128 gives the following visual output:
Repro case:
I cannot reproduce this on latest version of the plugin. I'm not sure if my setup is the right one to reproduce this. Your flutter doctor -v
would be useful!
Attempting to run the Flutter Google Maps hello world
I assume this means the example app in google_maps_flutter
? As indicated on pub.dev, that package currently only supports iOS and Android. See also https://pub.dev/packages/google_maps_flutter_web#depend-on-the-package
@ditman Is there an issue tracking endorsing Maps for web?
I can see the plugin google_maps_flutter_web does not have GoogleMap and other things, so the dart code is taking these elements from google_maps_flutter. Or I'm not sure how to implement the plugin google_maps_flutter_web
@pedromassango here ya go:
$ flutter doctor -v
[✓] Flutter (Channel beta, 2.2.0-10.1.pre, on macOS 11.2.3 20D91 darwin-x64,
locale en)
• Flutter version 2.2.0-10.1.pre at /Users/brettmorgan/flutter
• Framework revision 0941968447 (6 days ago), 2021-04-15 12:01:02 -0700
• Engine revision d2a2e93510
• Dart version 2.13.0 (build 2.13.0-211.6.beta)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/brettmorgan/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.55.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.21.0
[✓] Connected device (3 available)
• Brett's iPhone (mobile) • 00008020-000A781A0C46002E • ios • iOS 14.4.2
• macOS (desktop) • macos • darwin-x64 • macOS 11.2.3 20D91 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.85
• No issues found!
@ditman Is there an issue tracking endorsing Maps for web?
@stuartmorgan Not that I can find, we can repurpose this one.
There's some instructions on how to use google_maps_flutter_web in its README, but those are getting a little bit stale (specially with versioning). We should update the docs about "Web Integration" in the main README, to at least point users to modifying their index.html with the SCRIPT tag at the bare minimum.
@domesticmouse I have an updated version of the example app (with little-to-no modifications) deployed here: https://dit-maps-tests.web.app (I deploy this manually, so it might get stale from time to time)
Here's another app with Google Maps Web: https://dit-tests.web.app (this might change because I use it to test miscellaneous stuff from time to time)
Here's the relevant dependencies on the second app's pubspec.yaml:
google_maps_flutter: ^2.0.3
google_maps_flutter_web: ^0.3.0
pointer_interceptor: ^0.9.0 # So the fAB doesn't cause a click on the Map.
Since google_maps_flutter_web
is not officially endorsed yet, the web
platform is not available on your app unless you depend on the _web plugin directly.
Can we document the blockers for endorsement here?
Can we document the blockers for endorsement here?
@stuartmorgan I don't think there are any significant blockers for endorsement, other than some missing features that might break. (Check the example app deployed above).
We should do a gap analysis and see if we feel comfortable endorsing a plugin that doesn't have 100% feature parity with the mobile version, and that might throw some exceptions from time to time because of it.
(Some of the current limitations are documented in the README.md of the plugin, btw, I can't remember if the list there is 100% exhaustive)
I don't believe it is worth blocking this endorsement on lack of parity. We should document what works where so developers aren't surprised, but I believe this Google maps on web capability is worth releasing.
IMO, I think we should endorse too. Non-endorsement of web plugins comes from a time where the testing support was not very good, but now that everything is rather well tested (and running in CI), we should do it.
I'll get this endorsed by EOW; I'll also check what other web plugins should be endorsed but aren't yet, and endorse them (@balvinderz recently endorsed image_picker_for_web, for example)
We should do a gap analysis and see if we feel comfortable endorsing a plugin that doesn't have 100% feature parity with the mobile version, and that might throw some exceptions from time to time because of it.
I'm fine with not having parity yet; I do think we should evaluate the specific behavior for the missing functionality to make sure it's reasonably clear about being missing, rather than buggy.
I attempted to do this, and the current issue is that the integration tests of the google_maps_flutter
package can't run on the web, because there's a "test-only" method channel, here:
That is used to inspect "private" things of the internal state of the map. That should be either:
(There's also this FakeMapsController that has its own channel, and that will probably break unit tests when run in --platform=chrome
)
- Modeled as a platform-interface available for testing
This is definitely the right solution for federation; we should never be assuming that a plugin implementation must use a specific method channel (or method channels at all).
This is definitely the right solution for federation; we should never be assuming that a plugin implementation must use a specific method channel (or method channels at all).
@stuartmorgan yeah, you're probably right. Maybe it makes sense to make those secret "testing-only" methods available for all, they do have a use, and they probably help make apps less "stateful" with regards to the maps widget.
If we only do a platform interface "for testing" this is going to be slightly more complex, I'm not sure we've ever extended a basic platform interface to add more methods before (maybe doable with extension methods?)
Anyway, this is probably the biggest hurdle WRT endorsing the google maps web plugin.
Maybe I haven't thought this through all the way, but if it's test-only I would expect it could be a completely separate thing that just happens to look structurally similar to a plugin platform interface (i.e., has an abstract interface that the tests are written against, and platform implementations that can be registered as the instance).
I would expect it could be a completely separate thing that just happens to look structurally similar to a plugin platform interface
@stuartmorgan yes, however for web, it needs to have access to a (very private) internal instance of the GoogleMaps object that is going to eventually handle most of the calls. I haven't put much thought into this either, so it might end up being super simple to solve!
I'd like to add Flutter for Web support to the Adding Google Maps to a Flutter app codelab. Should I document adding google_maps_flutter_web
as a dependency or should I wait until this package is federated?
Should I document adding google_maps_flutter_web as a dependency or should I wait until this package is federated?
Please, do document adding the web dependency, I haven't had time to look at the next steps for this yet.
I've added instructions for web to the Google Maps codelab. Thanks!
Thanks for doing that @domesticmouse, and apologies for the inconvenience!! :/
Ehh... not to put salt in any wound here... ...but is there hope for Google Maps on Desktop, since there is some kind of hope in the sentence "TargetPlatform.windows is not yet supported by this maps plugin" ?
@RoarGronmo This issue is about web; please file a new issue for the desktop platform you want to request support for (currently only macOS has been filed).
I should have a PR ready this week.
The web version of Google Maps is now endorsed!
https://pub.dev/packages/google_maps_flutter/changelog#230
(From v 2.3.0)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
Tracking bug for implementing support for
TargetPlatform.macOS
in the Flutter Google Maps Plugin for Web.A workaround would also be good, if appropriate.