-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[google_maps_flutter] Migrate iOS heatmaps to Pigeon #10754
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
[google_maps_flutter] Migrate iOS heatmaps to Pigeon #10754
Conversation
There was a problem hiding this 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 is a great improvement, migrating the iOS heatmap implementation from legacy JSON serialization to a fully typed Pigeon data model. This refactoring significantly enhances type safety, code clarity, and maintainability. The changes are comprehensive, covering Dart and Objective-C code, updating tests to reflect the new data structures, and correctly removing the old serialization logic. I have one minor suggestion for a small efficiency improvement in the Dart code.
| static PlatformHeatmapGradient? _platformHeatmapGradientFromHeatmapGradient( | ||
| HeatmapGradient? gradient, | ||
| ) { | ||
| if (gradient == null) { | ||
| return null; | ||
| } | ||
| return PlatformHeatmapGradient( | ||
| colors: gradient.colors | ||
| .map( | ||
| (HeatmapGradientColor c) => PlatformColor( | ||
| red: c.color.r, | ||
| green: c.color.g, | ||
| blue: c.color.b, | ||
| alpha: c.color.a, | ||
| ), | ||
| ) | ||
| .toList(), | ||
| startPoints: gradient.colors | ||
| .map((HeatmapGradientColor c) => c.startPoint) | ||
| .toList(), | ||
| colorMapSize: gradient.colorMapSize, | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid iterating over gradient.colors twice, you can use a single loop to build both the colors and startPoints lists. This can be slightly more efficient and arguably makes it clearer that the two lists are built in tandem.
static PlatformHeatmapGradient? _platformHeatmapGradientFromHeatmapGradient(
HeatmapGradient? gradient,
) {
if (gradient == null) {
return null;
}
final List<PlatformColor> colors = <PlatformColor>[];
final List<double> startPoints = <double>[];
for (final HeatmapGradientColor c in gradient.colors) {
colors.add(PlatformColor(
red: c.color.r,
green: c.color.g,
blue: c.color.b,
alpha: c.color.a,
));
startPoints.add(c.startPoint);
}
return PlatformHeatmapGradient(
colors: colors,
startPoints: startPoints,
colorMapSize: gradient.colorMapSize,
);
}flutter/packages@e57e7f4...eb9e1dc 2026-01-13 stuartmorgan@google.com [google_maps_flutter] Migrate iOS heatmaps to Pigeon (flutter/packages#10754) 2026-01-13 magder@google.com Set Gemini Code Assist include_drafts to false (flutter/packages#10765) 2026-01-12 6655696+guidezpl@users.noreply.github.com [google_fonts] Update the font generator to exclude variable font entries when a static entry of the same weight and style exists (flutter/packages#10739) 2026-01-12 dasyad00@gmail.com [camera_android_camerax] get camera name from Camera2CameraInfo.getCameraId in availableCameras (flutter/packages#10775) 2026-01-12 49699333+dependabot[bot]@users.noreply.github.com Bump peter-evans/create-pull-request from 7.0.0 to 8.0.0 in the all-github-actions group (flutter/packages#10773) 2026-01-12 engine-flutter-autoroll@skia.org Roll Flutter from 3134be8 to d81cd3e (11 revisions) (flutter/packages#10779) 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
…r#180907) flutter/packages@e57e7f4...eb9e1dc 2026-01-13 stuartmorgan@google.com [google_maps_flutter] Migrate iOS heatmaps to Pigeon (flutter/packages#10754) 2026-01-13 magder@google.com Set Gemini Code Assist include_drafts to false (flutter/packages#10765) 2026-01-12 6655696+guidezpl@users.noreply.github.com [google_fonts] Update the font generator to exclude variable font entries when a static entry of the same weight and style exists (flutter/packages#10739) 2026-01-12 dasyad00@gmail.com [camera_android_camerax] get camera name from Camera2CameraInfo.getCameraId in availableCameras (flutter/packages#10775) 2026-01-12 49699333+dependabot[bot]@users.noreply.github.com Bump peter-evans/create-pull-request from 7.0.0 to 8.0.0 in the all-github-actions group (flutter/packages#10773) 2026-01-12 engine-flutter-autoroll@skia.org Roll Flutter from 3134be8 to d81cd3e (11 revisions) (flutter/packages#10779) 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
Replaces the legacy JSON serialization of heatmaps with fully typed Pigeon data.
Updates the min Flutter SDK version to 3.35 (stable N-1) because there's an analysis difference between 3.32 and 3.35 in some of the new Dart code, and it's easier to just drop 3.32 now than to add a suppression and then clean it up later.
Final iOS portion of flutter/flutter#117907
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).Footnotes
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