-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[google_maps_flutter_web] Migrate to null-safety. #3726
Conversation
879f9a4 to
a45705a
Compare
...e_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_plugin_test.dart
Outdated
Show resolved
Hide resolved
...e_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_plugin_test.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/markers_test.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_flutter_web.dart
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/circle.dart
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/circle.dart
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart
Outdated
Show resolved
Hide resolved
|
I need to rebase this with the latest master, to accomodate the changes made in [ci] and web plugins. |
a635ba8 to
201e3e5
Compare
|
(This should now attempt to run the modified tests in the |
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.
Mostly small comments. I'm still concerned at a high level by the amount of ! usage in ways that are not locally obviously correct (e.g., not cases like using a field right after checking that it's not null).
A lot of that is driven by the dispose system. I think it would be worth trying to separate the objects that have that pattern into a wrapper and an impl, where the impl has essentially all of the logic and all the fields are non-null, and the wrapper forwards to that object, and has dispose throw the whole impl away. It might be relatively straightforward to change?
packages/google_maps_flutter/google_maps_flutter_web/example/README.md
Outdated
Show resolved
Hide resolved
...ps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/marker_test.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/shape_test.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/shape_test.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_flutter_web.dart
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart
Show resolved
Hide resolved
f0ac203 to
a69a8d0
Compare
@stuartmorgan for now, I ended up guarding all the This could benefit from a refactor more in the style that you did with the geometry stuff in the core package (all "geometry" shares a set of base classes that have some default behavior, like dispose), but I'd rather introduce that change in another PR. This one is complex enough as is :/ |
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.
Okay, LGTM then. I do think followup refactoring to reduce the use of ! would be helpful, but I'm fine with proceeding as-is.
|
Rebasing with the latest master to resolve example/pubspec.yaml conflict. |
479a543 to
0f701b1
Compare
|
Published as google_maps_flutter_web: ^0.3.0 |
* Updates JS-interop package to google_maps ^5.1.0 * Breaking changes: * The property `icon` of a `Marker` cannot be `null`. Defaults to `BitmapDescriptor.defaultMarker` * The property `initialCameraPosition` of a `GoogleMapController` can't be `null`. It is also marked as `required`. * The parameter `creationId` of the `buildView` method cannot be `null` (this should be handled internally for users of the plugin) * Most of the Controller methods can't be called after `remove`/`dispose`. Calling these methods now will throw an Assertion error. Before it'd be a no-op, or a null-pointer exception.
This PR migrates the
google_maps_flutter_webpackage to null safety. To do so, certain things needed to change:google_mapsplugin has been updated to^5.0.0^5.1.0. Thanks @a14n!mockito, and howgoogle_mapsis now put together (mockito can't mock extension methods).The following changes were applied to the mocking strategy of this package:
Issues
Fixes flutter/flutter#74261
Fixes flutter/flutter#75236
Fixes flutter/flutter#75247
Testing
Pre-launch Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.