-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[google_maps_flutter_android] Convert Circle and Marker to Pigeon #7326
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_android] Convert Circle and Marker to Pigeon #7326
Conversation
stuartmorgan-g
left a comment
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.
A few initial notes.
I'll update and land #7207 tomorrow now that the other PRs it was going to collide with have landed; that will make the diffs here (and in follow-up object conversion PRs) much easier to review because you'll be able to actually replace the JSON codepaths instead of duplicating them, so it will be very easy to see what's the same and what's changing.
packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/marker.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md
Outdated
Show resolved
Hide resolved
...ges/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart
Outdated
Show resolved
Hide resolved
| this.visible = true, | ||
| this.strokeWidth = 10, | ||
| this.zIndex = 0.0, | ||
| this.radius = 0, |
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.
Optional: you can generally just make everything required in a Pigeon definition for a class like this that corresponds pretty directly to an existing class, because in practice there are usual no calls that don't provide every field due to the nature of how we use them.
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.
At least one case where they were not all provided is the Java unit tests prior to this PR. Technically there was only one field at that time, the json, but that json field only had the fields specified that were actually tested by the unit tests. If any of the non-null fields are not provided to the Builder nested class, build will throw an exception. I was hoping that providing default values would mean that the Builder would use them and not require them all to be specified, avoiding this problem, but it appears that the generated Java code does not use the defaults anyway.
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.
Yes, default values haven't been implemented for any of the just languages. Usually for unit tests we just make a helper that builds the object with mostly default values.
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.
@yaakovschectman did you and stuart agree not to make these values required?
| this.rotation = 0.0, | ||
| this.visible = true, | ||
| this.zIndex = 0.0, | ||
| this.clusterManagerId, |
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.
Same note here.
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.
Should there be a note here? (my guess is no since id is a string but thought it was worth asking.
|
Okay, #7207 has landed, so you can merge in |
|
I feel like I should have known that but thanks for the explanation. Ignore my comment then. |
…id/src/main/java/io/flutter/plugins/googlemaps/Convert.java Co-authored-by: Reid Baker <hamilton.reid.baker@gmail.com>
fdc0b3c to
39a0369
Compare
|
Is this ready for me to re-review, or still in progress? |
|
I thought I re requested already.
…On Mon, Aug 12, 2024, 7:52 AM stuartmorgan ***@***.***> wrote:
Is this ready for me to re-review, or still in progress?
—
Reply to this email directly, view it on GitHub
<#7326 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2AOOLDSX7G36DBA4DNIAJTZRCOYTAVCNFSM6AAAAABMDDYARWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBTG43DGNJSGU>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
stuartmorgan-g
left a comment
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.
There's one unaddressed comment from the last round, but otherwise LGTM!
|
|
||
| private void addJsonMarker(Map<String, ?> marker) { | ||
| private void addMarker(Messages.PlatformMarker marker) { | ||
| if (marker == null) { |
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.
I don't see any changes or response to this.
| this.visible = true, | ||
| this.strokeWidth = 10, | ||
| this.zIndex = 0.0, | ||
| this.radius = 0, |
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.
@yaakovschectman did you and stuart agree not to make these values required?
| final bool consumeTapEvents; | ||
| final bool draggable; | ||
| final bool flat; | ||
| final Object icon; |
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.
This is still missing a note and TODO
| this.rotation = 0.0, | ||
| this.visible = true, | ||
| this.zIndex = 0.0, | ||
| this.clusterManagerId, |
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.
Should there be a note here? (my guess is no since id is a string but thought it was worth asking.
|
@reidbaker If I am interpreting correctly, Stuart stated his note on whether the fields are required was optional, and approved the PR. I do not see why we would need a note for |
Oops, I missed that in my re-review. Thanks for the catch!
Yes, I'm fine with there being default values. I have a very slight preference for |
|
@reidbaker For the ID, are you asking because the Dart code uses specialized wrapper objects for each ID type? If so, I've been ignoring that at the Pigeon level since I think it's more busywork than benefit at the level of a transfer protocol, and just using strings directly. The objects have more value at the client-code level where things are being stored, passed around, etc. and could plausibly be passed back to the wrong APIs later by buggy client code. |
I was asking because you had a comment saying "same here" and I was trying to figure out what comment applied. |
Oh, I see it inline now. I still don't understand how GitHub displays responses sometimes 😐 I should have been clearer about what the "same" was; I meant it to refer to not needing default values for all the fields in that object, not about the comment. Sorry for the confusion! |
flutter/packages@e4f2247...86d15a6 2024-08-15 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.26.0 to 3.26.2 (flutter/packages#7417) 2024-08-15 tarrinneal@gmail.com [shared_preferences] remove testing section from README (flutter/packages#7410) 2024-08-13 nathan.wilson1232@gmail.com Fix breakages introduced by `SplashFactory` (flutter/packages#6952) 2024-08-13 engine-flutter-autoroll@skia.org Manual roll Flutter from 2afc452 to cc13cd1 (6 revisions) (flutter/packages#7404) 2024-08-13 109111084+yaakovschectman@users.noreply.github.com [google_maps_flutter_android] Convert Circle and Marker to Pigeon (flutter/packages#7326) 2024-08-13 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump androidx.annotation:annotation from 1.8.1 to 1.8.2 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#7379) 2024-08-13 49699333+dependabot[bot]@users.noreply.github.com [file_selector]: Bump androidx.annotation:annotation from 1.8.1 to 1.8.2 in /packages/file_selector/file_selector_android/android (flutter/packages#7381) 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,rmistry@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
flutter/packages@e4f2247...86d15a6 2024-08-15 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.26.0 to 3.26.2 (flutter/packages#7417) 2024-08-15 tarrinneal@gmail.com [shared_preferences] remove testing section from README (flutter/packages#7410) 2024-08-13 nathan.wilson1232@gmail.com Fix breakages introduced by `SplashFactory` (flutter/packages#6952) 2024-08-13 engine-flutter-autoroll@skia.org Manual roll Flutter from 2afc452 to cc13cd1 (6 revisions) (flutter/packages#7404) 2024-08-13 109111084+yaakovschectman@users.noreply.github.com [google_maps_flutter_android] Convert Circle and Marker to Pigeon (flutter/packages#7326) 2024-08-13 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump androidx.annotation:annotation from 1.8.1 to 1.8.2 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#7379) 2024-08-13 49699333+dependabot[bot]@users.noreply.github.com [file_selector]: Bump androidx.annotation:annotation from 1.8.1 to 1.8.2 in /packages/file_selector/file_selector_android/android (flutter/packages#7381) 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,rmistry@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
flutter/packages@e4f2247...86d15a6 2024-08-15 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.26.0 to 3.26.2 (flutter/packages#7417) 2024-08-15 tarrinneal@gmail.com [shared_preferences] remove testing section from README (flutter/packages#7410) 2024-08-13 nathan.wilson1232@gmail.com Fix breakages introduced by `SplashFactory` (flutter/packages#6952) 2024-08-13 engine-flutter-autoroll@skia.org Manual roll Flutter from 2afc452 to cc13cd1 (6 revisions) (flutter/packages#7404) 2024-08-13 109111084+yaakovschectman@users.noreply.github.com [google_maps_flutter_android] Convert Circle and Marker to Pigeon (flutter/packages#7326) 2024-08-13 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump androidx.annotation:annotation from 1.8.1 to 1.8.2 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#7379) 2024-08-13 49699333+dependabot[bot]@users.noreply.github.com [file_selector]: Bump androidx.annotation:annotation from 1.8.1 to 1.8.2 in /packages/file_selector/file_selector_android/android (flutter/packages#7381) 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,rmistry@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
Utilize static typing for pigeon message objects for Marker and Circle in
google_maps_flutter_android.Draft for now to run tests.
List which issues are fixed by this PR. You must list at least one issue.
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.