You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[google_maps_flutter_web] Stop listening to map events when disposed (flutter#9250)
Fixesflutter/flutter#168782
## Pre-Review Checklist
- [/] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [/] I read the [Tree Hygiene] page, which explains my responsibilities.
- [/] I read and followed the [relevant style guides] and ran [the auto-formatter].
- [/] I signed the [CLA].
- [/] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]`
- [/] I [linked to at least one issue that this PR fixes] in the description above.
- [/] I updated `pubspec.yaml` with an appropriate new version according to the [pub versioning philosophy], or I have commented below to indicate which [version change exemption] this PR falls under[^1].
- [/] I updated `CHANGELOG.md` to add a description of the change, [following repository CHANGELOG style], or I have commented below to indicate which [CHANGELOG exemption] this PR falls under[^1].
- [/] I updated/added any relevant documentation (doc comments with `///`).
- [/] I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1].
- [/] All existing and new tests are passing.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Copy file name to clipboardExpand all lines: packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.dart
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -310,6 +310,46 @@ void main() {
310
310
expect(events[4], isA<CameraIdleEvent>());
311
311
});
312
312
313
+
testWidgets('stops listening to map events once disposed', (
314
+
WidgetTester tester,
315
+
) async {
316
+
controller =
317
+
createController()
318
+
..debugSetOverrides(
319
+
createMap: (_, __) => map,
320
+
circles: circles,
321
+
heatmaps: heatmaps,
322
+
markers: markers,
323
+
polygons: polygons,
324
+
polylines: polylines,
325
+
groundOverlays: groundOverlays,
326
+
)
327
+
..init();
328
+
329
+
controller.dispose();
330
+
331
+
// Trigger events on the map, and verify they've been broadcast to the stream
0 commit comments