-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[google_maps_flutter] Switch app-facing package to new analysis options #4716
Conversation
|
We do not want custom analysis rules in flutter/plugins. See flutter/flutter#76229 if you are interested in fixing analysis issues in the maps plugin, as that's the direction we want to go. If there are things in flutter_lints that aren't in the repository settings, we should evaluate adding them there so the apply to all code. |
|
@stuartmorgan Since custom_analysis.yaml has entire |
You need to do the entire package, not just the example. You don't need to do all three at once (and ideally shouldn't).
I'm not sure what this means. What runtime type changes were you making? |
This comment was marked as resolved.
This comment was marked as resolved.
If this includes method channel code, you need to be very careful do do the right combinations of |
flutter_lints to the example and fix lint issues|
@stuartmorgan |
|
It looks like this doesn't pass tests currently. |
# Conflicts: # script/configs/custom_analysis.yaml
|
Hey @stuartmorgan |
|
@stuartmorgan |
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.
Thanks for this cleanup! Just a few small things.
packages/google_maps_flutter/google_maps_flutter/example/lib/scrolling_map.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart
Outdated
Show resolved
Hide resolved
| await tester.pumpWidget(_mapWithPolygons(<Polygon>{p1})); | ||
|
|
||
| p1.points.add(const LatLng(1.0, 1.0)); | ||
| _points.add(const LatLng(1.0, 1.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.
What was this set of changes fixing? The code seems less clear now, so I'm wondering if we can fix it differently.
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 meant to add final List<LatLng> _points = <LatLng>[const LatLng(0.0, 0.0)]; to p1, to make _points list modifiable
Otherwise, it throws Unsupported operation: Cannot add to an unmodifiable list
During local testing, I modified this line and probably forget to revert this line after making the changes above, thanks
+ final List<LatLng> _points = <LatLng>[const LatLng(0.0, 0.0)];
final Polygon p1 = Polygon(
- polylineId: PolylineId("polyline_1"),
+ polygonId: const PolygonId('polygon_1'),
- points: <LatLng>[const LatLng(0.0, 0.0)],
+ points: _points,
);
await tester.pumpWidget(_mapWithPolygons(<Polygon>{p1}));
p1.points.add(const LatLng(1.0, 1.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.
I see, the reason this code looks strange is because it is; looking at the blame this is testing that we notice if someone modifies what is supposed to be an immutable object.
packages/google_maps_flutter/google_maps_flutter/test/polyline_updates_test.dart
Show resolved
Hide resolved
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.
LGTM, thanks!
| await tester.pumpWidget(_mapWithPolygons(<Polygon>{p1})); | ||
|
|
||
| p1.points.add(const LatLng(1.0, 1.0)); | ||
| _points.add(const LatLng(1.0, 1.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.
I see, the reason this code looks strange is because it is; looking at the blame this is testing that we notice if someone modifies what is supposed to be an immutable object.
Switches from legacy analysis options to current analysis options,
fixing all analysis issues it exposed.
Part of flutter/flutter#76229
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.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.