Repository navigation
[google_maps_flutter] Add background color for unloaded tiles - #12357
RyanHolanda wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a backgroundColor option to GoogleMap to configure the color displayed behind unloaded map tiles. This change is implemented across the main package, the platform interface, and the Android, iOS, and Web platform implementations, along with corresponding tests. There are no review comments, and I have no feedback to provide.
stuartmorgan-g
left a comment
There was a problem hiding this comment.
Overall the structure looks good, thanks for the contribution!
Routing to platform teams for in-depth review of platform implementations before the PR is split apart.
| style: config.style, | ||
| backgroundColor: config.backgroundColor == null | ||
| ? null | ||
| : PlatformColor(argbValue: config.backgroundColor!.toARGB32()), |
There was a problem hiding this comment.
Prefer creating a local backgroundColor variable and using that, so that you can rely on compiler-enforced autopromotion instead of force-unwrapping.
There was a problem hiding this comment.
Fixed in d318693. I now store config.backgroundColor in a local Color? and use the promoted local for the conversion, removing the force unwrap.
| style: options['style'] as String?, | ||
| backgroundColor: options['backgroundColor'] == null | ||
| ? null | ||
| : PlatformColor(argbValue: options['backgroundColor']! as int), |
There was a problem hiding this comment.
Fixed in d318693. The legacy options path now stores options["backgroundColor"] in a local int? and uses compiler promotion instead of force-unwrapping the map lookup.
| style: config.style, | ||
| backgroundColor: config.backgroundColor == null | ||
| ? null | ||
| : _platformColorFromColor(config.backgroundColor!), |
There was a problem hiding this comment.
Same notes here as for Android.
There was a problem hiding this comment.
Fixed in d318693. I applied the same promoted-local pattern to both analogous iOS conversion paths. Android/iOS analysis and all package and example Dart tests pass.
mdebbar
left a comment
There was a problem hiding this comment.
The web changes are straightforward and look good to me!
aa96f6f to
dffba86
Compare
|
This pull request is not mergeable in its current state, likely because of a merge conflict. Pre-submit CI jobs were not triggered. Pushing a new commit to this branch that resolves the issue will result in pre-submit jobs being scheduled. |
|
@RyanHolanda Can you resolve the merge conflicts so we can get the tests to run? |
d318693 to
b0ef5a7
Compare
|
@vashworth Resolved, thanks! I rebased the PR onto the current Locally, all seven affected packages pass |
b0ef5a7 to
28d6755
Compare
|
Resolved again. The new conflicts came from #12307 converting the maintained SDK9/SDK10/shared iOS controller code to Swift; that upstream change did not duplicate this PR’s I rebased onto current Validation passes for all affected packages ( @vashworth Could you please take another look? |
c2ff6a5 to
d8fbe63
Compare
|
@LouiseHsu Thanks for the heads-up! I rebased the PR onto the latest |
|
autosubmit label was removed for flutter/packages/12357, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
|
Hi @RyanHolanda could you update the versions of the package following https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version-and-changelog-updates? I think the CI is failing because of that. |
|
@LongCatIsLooong Thanks for catching this! |
|
@RyanHolanda FYI this is failing CI with: |
|
@hellohuanlin Thanks for flagging this. The The interface-only PR #13014 has merged, but |
|
@tarrinneal @bparrishMines for maps owners to publish 2.18.0 |
Adds a nullable
GoogleMap.backgroundColoroption for configuring the color displayed behind map tiles while they are not fully loaded.This prevents the native map surface from showing its default black background before tiles render. The value is forwarded during map initialization to:
GoogleMapOptions.backgroundColor.GMSMapViewOptions.backgroundColorin the default, SDK 9, and SDK 10 implementations.MapOptions.backgroundColor.The existing SDK defaults remain unchanged when
backgroundColoris null. Since the native options are initialization-time settings, changing the value after map creation has no effect.No screenshots are included because this is an API-only platform integration change.
Fixes flutter/flutter#142520
Federated review note
This is the required combined-review PR for the federated plugin change. It intentionally contains repository-generated path dependency overrides marked
DO NOT MERGEso the platform interface, implementations, and app-facing package can be reviewed and tested together.The package publish dry-run passes for all seven packages. The federation safety check intentionally reports
Unresolved combo PR, preventing this combined review branch from landing accidentally. Once the overall change is approved, it will be split and landed in dependency order:Test coverage
The change adds coverage for:
GMSMapViewOptionscreation across all maintained SDK implementations.Local validation completed:
On the local Xcode 26.5 installation, the default CocoaPods native target is blocked before plugin tests by warnings promoted to errors in the third-party
Google-Maps-iOS-Utilssource. The identical shared implementation passes in the SDK 9 and SDK 10 targets; hosted CI will validate the repository's supported CocoaPods environment.Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.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