Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g commented Nov 19, 2025

This fixes two sets of API deprecations:

  • Within the package, cloudMapId was deprecated in the platform interface, and replaced with mapId. This updates everything that's not client-facing to use the mapId name instead (except for local variables in native code, where it ensure there's no potential confusion with the plugin-level map ID that tracks map instances in the plugin).
  • Color.value is deprecated. Rather than just replace it with toARGB(), this adds structured data to the Pigeon interface, so that it's not relying on magic knowledge on both sides of the interface that the ints are ARGB:
    • On Android, where the native SDK color representation is just a 32-bit ARGB, this adds a wrapper class to make that explicit in the Pigeon API surface.
    • On iOS, where UIColor uses four doubles, this passes the underlying Color doubles directly via the wrapper class, so that it's not lossy.
    • For legacy JSON representation still used for heatmaps, it just continues to use the equivalent toARGB(). That will change once heatmaps are converted to Pigeon.

This also annotates a couple of intentional internal uses of the deprecated legacy renderer type so that it won't show up in future repository deprecation audits.

Also pays down some tech debt by renaming the now-very-poorly-named FLTGoogleMapJSONConversions.* file to FGMConversionUtils, since it is now mostly Pigeon type conversions. It also renames the legacy FLTGoogleMapJSONConversions bag-of-class-methods class to reflect that it is now only used for heatmaps, the last type that still uses JSON serialization in the Pigeon interface
(flutter/flutter#117907).

Part of flutter/flutter#159739

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

This fixes two sets of API deprecations:
- Within the package, cloudMapId was deprecated in the platform
  interface, and replaced with mapId. This updates everything that's not
  client-facing to use the mapId name instead (except for local
  variables in native code, where it ensure there's no potential
  confusion with the plugin-level map ID that tracks map instances in
  the plugin).
- `Color.value` is deprecated. Rather than just replace it with
  `toARGB()`, this adds structured data to the Pigeon interface, so that
  it's not relying on magic knowledge on both sides of the interface
  that the ints are ARGB:
  - On Android, where the native SDK color representation is just a
    32-bit ARGB, this adds a wrapper class to make that explicit in the
    Pigeon API surface.
  - On iOS, where `UIColor` uses four doubles, this passes the
    underlying `Color` doubles directly via the wrapper class, so that
    it's not lossy.
  - For legacy JSON representations, it continues to use the equivalent
    `toARGB()` directly, since it must remain compatible.

This also annotates a couple of intentional internal uses of the
deprecated `legacy` renderer type so that it won't show up in future
repository deprecation audits.

Also pays down some tech debt by renaming the now-very-poorly-named
FLTGoogleMapJSONConversions.* file to FGMConversionUtils, since it is
now mostly Pigeon type conversions. It also renames the legacy
FLTGoogleMapJSONConversions bag-of-class-methods class to reflect that
it is now only used for heatmaps, the last type that still uses JSON
serialization in the Pigeon interface
(flutter/flutter#117907).

Part of flutter/flutter#159739
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully replaces deprecated APIs, namely cloudMapId and Color.value, across the google_maps_flutter package and its platform implementations. The introduction of a structured PlatformColor type in Pigeon is a significant improvement for type safety and clarity between Dart and native code. The file and class renames to address technical debt are also valuable changes. The overall implementation is systematic and well-executed. I have a few minor suggestions to enhance code clarity by renaming some local variables to align with the new mapId property, which would further improve consistency.

auto-submit bot pushed a commit that referenced this pull request Nov 20, 2025
…face (#10477)

Replaces the deprecated `Color.value` with the replacement `toARGB()`. Since this is for legacy JSON representations, it continues it must remain compatible, so uses the same representation (unlike #10474 where it's replaced with structured representations).

Part of flutter/flutter#159739

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
sink.setVisible(polygon.getVisible());
sink.setFillColor(polygon.getFillColor().intValue());
sink.setStrokeColor(polygon.getStrokeColor().intValue());
sink.setFillColor(polygon.getFillColor().getArgbValue().intValue());
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont love that despite moving to a more type safe implementation that we still have a lossy call here to intValue.

I dont need you to change anything.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's not ideal. This is a fundamental Dart/Java impedance mismatch though; Dart just doesn't have a standard 32-bit integer type, so:

  1. there's no type-level mechanism to enforce that Color.toARGB32() on the Dart side actually returns a number within the 32-bit int range, and
  2. there's also no way to express that restriction in the Pigeon interface definition.

In theory we could fix (2) with a Pigeon annotation (that would tell Pigeon to generate 32-bit types in the native interfaces, instead of always using 64-bit types), but that would just mean we'd have a theoretical runtime failure point in a different place because of (1).

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 25, 2025
@auto-submit auto-submit bot merged commit 43873c3 into flutter:main Nov 25, 2025
80 checks passed
agrapine pushed a commit to swipelab/flutter_packages that referenced this pull request Nov 26, 2025
This fixes two sets of API deprecations:
- Within the package, cloudMapId was deprecated in the platform interface, and replaced with mapId. This updates everything that's not client-facing to use the mapId name instead (except for local variables in native code, where it ensure there's no potential confusion with the plugin-level map ID that tracks map instances in the plugin).
- `Color.value` is deprecated. Rather than just replace it with `toARGB()`, this adds structured data to the Pigeon interface, so that it's not relying on magic knowledge on both sides of the interface that the ints are ARGB:
  - On Android, where the native SDK color representation is just a 32-bit ARGB, this adds a wrapper class to make that explicit in the Pigeon API surface.
  - On iOS, where `UIColor` uses four doubles, this passes the underlying `Color` doubles directly via the wrapper class, so that it's not lossy.
  - For legacy JSON representation still used for heatmaps, it just continues to use the equivalent `toARGB()`. That will change once heatmaps are converted to Pigeon.

This also annotates a couple of intentional internal uses of the deprecated `legacy` renderer type so that it won't show up in future repository deprecation audits.

Also pays down some tech debt by renaming the now-very-poorly-named FLTGoogleMapJSONConversions.* file to FGMConversionUtils, since it is now mostly Pigeon type conversions. It also renames the legacy FLTGoogleMapJSONConversions bag-of-class-methods class to reflect that it is now only used for heatmaps, the last type that still uses JSON serialization in the Pigeon interface
(flutter/flutter#117907).

Part of flutter/flutter#159739

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 26, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Nov 27, 2025
flutter/packages@cc3dca6...5d8d954

2025-11-26 [email protected] [video_player_avfoundation] Create a
Dart player instance (flutter/packages#10490)
2025-11-25 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.maps.android:android-maps-utils from 3.6.0
to 3.19.1 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#10390)
2025-11-25 [email protected] [path_provider] Revert iOS/macOS to
plugin-based implementation (flutter/packages#10517)
2025-11-25 [email protected] [google_maps_flutter] Replace
deprecated APIs (flutter/packages#10474)
2025-11-25 [email protected] [tool] Remove code analysis from
podspec-check (flutter/packages#10484)

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 [email protected] 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
mboetger pushed a commit to mboetger/flutter that referenced this pull request Dec 2, 2025
)

flutter/packages@cc3dca6...5d8d954

2025-11-26 [email protected] [video_player_avfoundation] Create a
Dart player instance (flutter/packages#10490)
2025-11-25 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.maps.android:android-maps-utils from 3.6.0
to 3.19.1 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#10390)
2025-11-25 [email protected] [path_provider] Revert iOS/macOS to
plugin-based implementation (flutter/packages#10517)
2025-11-25 [email protected] [google_maps_flutter] Replace
deprecated APIs (flutter/packages#10474)
2025-11-25 [email protected] [tool] Remove code analysis from
podspec-check (flutter/packages#10484)

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 [email protected] 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
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
)

flutter/packages@cc3dca6...5d8d954

2025-11-26 [email protected] [video_player_avfoundation] Create a
Dart player instance (flutter/packages#10490)
2025-11-25 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.maps.android:android-maps-utils from 3.6.0
to 3.19.1 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#10390)
2025-11-25 [email protected] [path_provider] Revert iOS/macOS to
plugin-based implementation (flutter/packages#10517)
2025-11-25 [email protected] [google_maps_flutter] Replace
deprecated APIs (flutter/packages#10474)
2025-11-25 [email protected] [tool] Remove code analysis from
podspec-check (flutter/packages#10484)

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 [email protected] 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
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-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants