Skip to content

[google_maps_flutter] Improve README and API doc comments #8560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 24, 2025

Conversation

filiph
Copy link
Contributor

@filiph filiph commented Feb 4, 2025

There are some inconsistencies and anachronisms in the various READMEs and in the API docs. This PR attempts to address them.

  • Makes sure to link to platform-specific READMEs from the main README file.
  • Makes the READMEs more consistent (e.g. only leaving the bare minimum quick start for the main README, and leaving all platform-specific notes to platform READMEs).
  • Using the more correct “Not supported on all platforms” instead of “Supported on Android only” for functionality that works on both Android and the Web. Intentionally staying vague in API docs in order to make later maintenance easier. (Map marker on web doesn't respect custom hue flutter#161948 (comment))
  • Remove a doc comment from before null safety about asserting non-null.
  • Format the platform sections in the main README so that they’re proper lists, and so that all of them end with a link to the appropriate platform-specific README.

Issues:

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

- Makes sure to link to platform-specific READMEs from the main README file.
- Makes the READMEs more consistent (e.g. only leaving the bare minimum quick start for the main README, and leaving all platform-specific notes to platform READMEs).
- Using the more correct “Not supported on all platforms” instead of “Supported on Android only” for functionality that works on both Android and the Web. Intentionally staying vague in API docs in order to make later maintenance easier. (flutter/flutter#161948 (comment))
- Remove a doc comment from before null safety about asserting non-null.
- Format the platform sections in the main README so that they’re proper lists, and so that all of them end with a link to the appropriate platform-specific README.
@filiph
Copy link
Contributor Author

filiph commented Feb 4, 2025

I see that an automated CHANGELOG check is failing. It felt weird to be updating the otherwise-laconic CHANGELOGs with documentation changes but I'm happy to do that.

@stuartmorgan-g
Copy link
Contributor

I see that an automated CHANGELOG check is failing.

See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#faq

@@ -32,84 +41,82 @@ For more details, see [Getting started with Google Maps Platform](https://develo

1. Set the `minSdkVersion` in `android/app/build.gradle`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just remove this whole bullet point while you are touching this; Flutter itself only supports 21+ now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -261,6 +264,8 @@ class GoogleMap extends StatefulWidget {
/// * The My Location button animates to focus on the user's current location
/// if the user's location is currently known.
///
/// This feature is not present in the Google Maps SDK for the web.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we wouldn't reference a specific platform here, but the ship has sailed on that below so we can do this now, and revisit the whole thing in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

@@ -78,6 +78,10 @@ Google Play the latest renderer will not be available and the legacy renderer wi
WARNING: `AndroidMapRenderer.legacy` is known to crash apps and is no longer supported by the Google Maps team
and therefore cannot be supported by the Flutter team.

#### Cloud-based map styling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous heading is ##, so this should be ###.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -78,6 +78,10 @@ Google Play the latest renderer will not be available and the legacy renderer wi
WARNING: `AndroidMapRenderer.legacy` is known to crash apps and is no longer supported by the Google Maps team
and therefore cannot be supported by the Flutter team.

#### Cloud-based map styling

Cloud-based map styling works on Android only if `AndroidMapRenderer.latest` map renderer has been initialized.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think people may read this as having to explicitly initialize the latest renderer, but in most cases it's the default now. How about "Cloud-based map styling is not supported with the legacy renderer."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@filiph
Copy link
Contributor Author

filiph commented Feb 10, 2025

Addressed feedback and incremented versions using update-release-info. The CI/CD for changelog is now green but the pipeline's failing elsewhere, in Firebase Test Lab. Snip:

More details are available at [ https://console.firebase.google.com/project/flutter-infra-staging/testlab/histories/bh.8eb89ae93eb3eb36/matrices/7103368191579169772 ].
┌─────────┬────────────────────────┬─────────────────────┐
│ OUTCOME │    TEST_AXIS_VALUE     │     TEST_DETAILS    │
├─────────┼────────────────────────┼─────────────────────┤
│ Failed  │ panther-33-en-portrait │ Application crashed │
└─────────┴────────────────────────┴─────────────────────┘

I don't have access to https://console.firebase.google.com/project/flutter-infra-staging/testlab/histories/bh.8eb89ae93eb3eb36/matrices/7103368191579169772 to check what exactly went wrong. Did I fudge something? I believe I only changed documentation but I'm a bit nervous because the failure is at packages/google_maps_flutter/google_maps_flutter_android which is one of the packages I touched.

@reidbaker
Copy link
Contributor

Logcat and video from the test attached.
The "overview" shows java.lang.IllegalStateException: Trying to call onSurfaceCreated with no current context

google-maps-crash.mp4

plugins_android_test_packages_google_maps_flutter_google_maps_flutter_android_unknown_build_3e8e411b-bfa1-4d48-8d13-793bec41437e_example_0_panther-33-en-portrait_logcat.txt

Have not dug in but the failure looks related.

@filiph
Copy link
Contributor Author

filiph commented Feb 10, 2025

I just went through the CL line by line and, FWIW, the only changes are:

  • README + CHANGELOG files
  • doc comments in .dart files
  • version bump

@stuartmorgan-g
Copy link
Contributor

The "overview" shows java.lang.IllegalStateException: Trying to call onSurfaceCreated with no current context

This is longstanding flake, apparently in the Google Maps SDK itself: flutter/flutter#159731

@stuartmorgan-g
Copy link
Contributor

which is one of the packages I touched.

The tooling in this repo is configured to only run tests on changed packages when the changes are restricted to packages (vs repo-wide configuration), so flake for a change like this will alway be from the packages you touched :)

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@filiph
Copy link
Contributor Author

filiph commented Feb 24, 2025

Sorry about the delay. The versions and changelogs have changed under me and I haven't noticed, but now it's back on track and ready to be merged.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 24, 2025
@auto-submit auto-submit bot merged commit 4341341 into flutter:main Feb 24, 2025
82 checks passed
@filiph filiph deleted the feat/maps-improve-docs branch February 24, 2025 16:45
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Feb 25, 2025
flutter/packages@5498d4d...c44c228

2025-02-24 engine-flutter-autoroll@skia.org Manual roll Flutter from
39b4951 to 911aa75 (56 revisions) (flutter/packages#8687)
2025-02-24 filiph@users.noreply.github.com [google_maps_flutter] Improve
README and API doc comments (flutter/packages#8560)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Mar 31, 2025
…#8754)

Two issues caught by @jokerttu after #8560 was already merged:

- a typo ("iOS-specific" --> "web-specific")
- a forgotten changelog entry
vashworth pushed a commit to vashworth/packages that referenced this pull request Mar 31, 2025
…flutter#8754)

Two issues caught by @jokerttu after flutter#8560 was already merged:

- a typo ("iOS-specific" --> "web-specific")
- a forgotten changelog entry
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
There are some inconsistencies and anachronisms in the various READMEs and in the API docs. This PR attempts to address them.

- Makes sure to link to platform-specific READMEs from the main README file.
- Makes the READMEs more consistent (e.g. only leaving the bare minimum quick start for the main README, and leaving all platform-specific notes to platform READMEs).
- Using the more correct “Not supported on all platforms” instead of “Supported on Android only” for functionality that works on both Android and the Web. Intentionally staying vague in API docs in order to make later maintenance easier. (flutter/flutter#161948 (comment))
- Remove a doc comment from before null safety about asserting non-null.
- Format the platform sections in the main README so that they’re proper lists, and so that all of them end with a link to the appropriate platform-specific README.

Issues:

- Fixes flutter/flutter#161954
- Related: flutter/flutter#161950, flutter/flutter#161948
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
…flutter#8754)

Two issues caught by @jokerttu after flutter#8560 was already merged:

- a typo ("iOS-specific" --> "web-specific")
- a forgotten changelog entry
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
There are some inconsistencies and anachronisms in the various READMEs and in the API docs. This PR attempts to address them.

- Makes sure to link to platform-specific READMEs from the main README file.
- Makes the READMEs more consistent (e.g. only leaving the bare minimum quick start for the main README, and leaving all platform-specific notes to platform READMEs).
- Using the more correct “Not supported on all platforms” instead of “Supported on Android only” for functionality that works on both Android and the Web. Intentionally staying vague in API docs in order to make later maintenance easier. (flutter/flutter#161948 (comment))
- Remove a doc comment from before null safety about asserting non-null.
- Format the platform sections in the main README so that they’re proper lists, and so that all of them end with a link to the appropriate platform-specific README.

Issues:

- Fixes flutter/flutter#161954
- Related: flutter/flutter#161950, flutter/flutter#161948
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
…flutter#8754)

Two issues caught by @jokerttu after flutter#8560 was already merged:

- a typo ("iOS-specific" --> "web-specific")
- a forgotten changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: google_maps_flutter platform-android platform-web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Maps throws when using map marker clustering on the web
4 participants