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,5 +1,6 @@
## NEXT
## 2.16.0

* Adds support for `mapTypeControlEnabled`, `fullscreenControlEnabled`, and `streetViewControlEnabled` for web.
* Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.

## 2.15.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class MapConfiguration {
this.indoorViewEnabled,
this.trafficEnabled,
this.buildingsEnabled,
this.mapTypeControlEnabled,
this.fullscreenControlEnabled,
this.streetViewControlEnabled,
String? mapId,
@Deprecated('cloudMapId is deprecated. Use mapId instead.') String? cloudMapId,
this.style,
Expand Down Expand Up @@ -67,6 +70,21 @@ class MapConfiguration {
/// True if the map toolbar should be shown.
final bool? mapToolbarEnabled;

/// True if map type control should be shown.
///
/// Web only.
final bool? mapTypeControlEnabled;

/// True if fullscreen control should be shown.
///
/// Web only.
final bool? fullscreenControlEnabled;

/// True if street view control should be shown.
///
/// Web only.
final bool? streetViewControlEnabled;

/// The bounds to display.
final CameraTargetBounds? cameraTargetBounds;

Expand Down Expand Up @@ -210,6 +228,15 @@ class MapConfiguration {
indoorViewEnabled: indoorViewEnabled != other.indoorViewEnabled ? indoorViewEnabled : null,
trafficEnabled: trafficEnabled != other.trafficEnabled ? trafficEnabled : null,
buildingsEnabled: buildingsEnabled != other.buildingsEnabled ? buildingsEnabled : null,
mapTypeControlEnabled: mapTypeControlEnabled != other.mapTypeControlEnabled
? mapTypeControlEnabled
: null,
fullscreenControlEnabled: fullscreenControlEnabled != other.fullscreenControlEnabled
? fullscreenControlEnabled
: null,
streetViewControlEnabled: streetViewControlEnabled != other.streetViewControlEnabled
? streetViewControlEnabled
: null,
mapId: mapId != other.mapId ? mapId : null,
style: style != other.style ? style : null,
markerType: markerType != other.markerType ? markerType : null,
Expand Down Expand Up @@ -244,6 +271,9 @@ class MapConfiguration {
indoorViewEnabled: diff.indoorViewEnabled ?? indoorViewEnabled,
trafficEnabled: diff.trafficEnabled ?? trafficEnabled,
buildingsEnabled: diff.buildingsEnabled ?? buildingsEnabled,
mapTypeControlEnabled: diff.mapTypeControlEnabled ?? mapTypeControlEnabled,
fullscreenControlEnabled: diff.fullscreenControlEnabled ?? fullscreenControlEnabled,
streetViewControlEnabled: diff.streetViewControlEnabled ?? streetViewControlEnabled,
mapId: diff.mapId ?? mapId,
style: diff.style ?? style,
markerType: diff.markerType ?? markerType,
Expand Down Expand Up @@ -275,6 +305,9 @@ class MapConfiguration {
indoorViewEnabled == null &&
trafficEnabled == null &&
buildingsEnabled == null &&
mapTypeControlEnabled == null &&
fullscreenControlEnabled == null &&
streetViewControlEnabled == null &&
mapId == null &&
style == null &&
markerType == null &&
Expand Down Expand Up @@ -311,6 +344,9 @@ class MapConfiguration {
indoorViewEnabled == other.indoorViewEnabled &&
trafficEnabled == other.trafficEnabled &&
buildingsEnabled == other.buildingsEnabled &&
mapTypeControlEnabled == other.mapTypeControlEnabled &&
fullscreenControlEnabled == other.fullscreenControlEnabled &&
streetViewControlEnabled == other.streetViewControlEnabled &&
mapId == other.mapId &&
style == other.style &&
markerType == other.markerType &&
Expand Down Expand Up @@ -341,6 +377,9 @@ class MapConfiguration {
indoorViewEnabled,
trafficEnabled,
buildingsEnabled,
mapTypeControlEnabled,
fullscreenControlEnabled,
streetViewControlEnabled,
mapId,
style,
markerType,
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.15.0
version: 2.16.0

environment:
sdk: ^3.10.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ void main() {
indoorViewEnabled: false,
trafficEnabled: false,
buildingsEnabled: false,
mapTypeControlEnabled: false,
fullscreenControlEnabled: false,
streetViewControlEnabled: false,
style: 'diff base style',
);

Expand Down Expand Up @@ -490,6 +493,42 @@ void main() {
// The hash code should change.
expect(empty.hashCode, isNot(diff.hashCode));
});

test('handle mapTypeControlEnabled', () async {
const diff = MapConfiguration(mapTypeControlEnabled: true);

const empty = MapConfiguration();
final MapConfiguration updated = diffBase.applyDiff(diff);

expect(empty.applyDiff(diff), diff);
expect(diff.diffFrom(empty), diff);
expect(updated.mapTypeControlEnabled, true);
expect(empty.hashCode, isNot(diff.hashCode));
});

test('handle fullscreenControlEnabled', () async {
const diff = MapConfiguration(fullscreenControlEnabled: true);

const empty = MapConfiguration();
final MapConfiguration updated = diffBase.applyDiff(diff);

expect(empty.applyDiff(diff), diff);
expect(diff.diffFrom(empty), diff);
expect(updated.fullscreenControlEnabled, true);
expect(empty.hashCode, isNot(diff.hashCode));
});

test('handle streetViewControlEnabled', () async {
const diff = MapConfiguration(streetViewControlEnabled: true);

const empty = MapConfiguration();
final MapConfiguration updated = diffBase.applyDiff(diff);

expect(empty.applyDiff(diff), diff);
expect(diff.diffFrom(empty), diff);
expect(updated.streetViewControlEnabled, true);
expect(empty.hashCode, isNot(diff.hashCode));
});
});

group('isEmpty', () {
Expand Down Expand Up @@ -649,5 +688,23 @@ void main() {

expect(diff.isEmpty, false);
});

test('is false with mapTypeControlEnabled', () async {
const diff = MapConfiguration(mapTypeControlEnabled: true);

expect(diff.isEmpty, false);
});

test('is false with fullscreenControlEnabled', () async {
const diff = MapConfiguration(fullscreenControlEnabled: true);

expect(diff.isEmpty, false);
});

test('is false with streetViewControlEnabled', () async {
const diff = MapConfiguration(streetViewControlEnabled: true);

expect(diff.isEmpty, false);
});
});
}
Loading