Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.9.2

* Corrects JSON tag for `CameraUpdateNewLatLngBounds`.

## 2.9.1

* Splits CameraUpdate into dervied classes for different update cases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class CameraUpdateNewLatLngBounds extends CameraUpdate {
/// The amount of padding by which the view is inset.
final double padding;
@override
Object toJson() => <Object>['newLatLngZoom', bounds.toJson(), padding];
Object toJson() => <Object>['newLatLngBounds', bounds.toJson(), padding];
}

/// Defines a camera move to new coordinates with a zoom level.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.9.1
version: 2.9.2

environment:
sdk: ^3.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ void main() {
expect(cameraUpdate.updateType, CameraUpdateType.newCameraPosition);
cameraUpdate as CameraUpdateNewCameraPosition;
expect(cameraUpdate.cameraPosition, cameraPosition);
final List<Object> jsonList = cameraUpdate.toJson() as List<Object>;
expect(jsonList[0], 'newCameraPosition');
});

test('CameraUpdate.newLatLng', () {
Expand All @@ -39,6 +41,8 @@ void main() {
expect(cameraUpdate.updateType, CameraUpdateType.newLatLng);
cameraUpdate as CameraUpdateNewLatLng;
expect(cameraUpdate.latLng, latLng);
final List<Object> jsonList = cameraUpdate.toJson() as List<Object>;
expect(jsonList[0], 'newLatLng');
});

test('CameraUpdate.newLatLngBounds', () {
Expand All @@ -52,6 +56,8 @@ void main() {
cameraUpdate as CameraUpdateNewLatLngBounds;
expect(cameraUpdate.bounds, latLngBounds);
expect(cameraUpdate.padding, padding);
final List<Object> jsonList = cameraUpdate.toJson() as List<Object>;
expect(jsonList[0], 'newLatLngBounds');
});

test('CameraUpdate.newLatLngZoom', () {
Expand All @@ -63,6 +69,8 @@ void main() {
cameraUpdate as CameraUpdateNewLatLngZoom;
expect(cameraUpdate.latLng, latLng);
expect(cameraUpdate.zoom, zoom);
final List<Object> jsonList = cameraUpdate.toJson() as List<Object>;
expect(jsonList[0], 'newLatLngZoom');
});

test('CameraUpdate.scrollBy', () {
Expand All @@ -74,6 +82,8 @@ void main() {
cameraUpdate as CameraUpdateScrollBy;
expect(cameraUpdate.dx, dx);
expect(cameraUpdate.dy, dy);
final List<Object> jsonList = cameraUpdate.toJson() as List<Object>;
expect(jsonList[0], 'scrollBy');
});

test('CameraUpdate.zoomBy', () {
Expand All @@ -85,17 +95,23 @@ void main() {
cameraUpdate as CameraUpdateZoomBy;
expect(cameraUpdate.amount, amount);
expect(cameraUpdate.focus, focus);
final List<Object> jsonList = cameraUpdate.toJson() as List<Object>;
expect(jsonList[0], 'zoomBy');
});

test('CameraUpdate.zoomIn', () {
final CameraUpdate cameraUpdate = CameraUpdate.zoomIn();
expect(cameraUpdate.runtimeType, CameraUpdateZoomIn);
expect(cameraUpdate.updateType, CameraUpdateType.zoomIn);
final List<Object> jsonList = cameraUpdate.toJson() as List<Object>;
expect(jsonList[0], 'zoomIn');
});

test('CameraUpdate.zoomOut', () {
final CameraUpdate cameraUpdate = CameraUpdate.zoomOut();
expect(cameraUpdate.runtimeType, CameraUpdateZoomOut);
expect(cameraUpdate.updateType, CameraUpdateType.zoomOut);
final List<Object> jsonList = cameraUpdate.toJson() as List<Object>;
expect(jsonList[0], 'zoomOut');
});
}