Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Autoformat
  • Loading branch information
stuartmorgan-g committed Feb 15, 2021
commit b60eee94be1d284dd84c0da2b936f9f5cbc79b48
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ class PlacePolygonBodyState extends State<PlacePolygonBody> {
void _addHoles(PolygonId polygonId) {
final Polygon polygon = polygons[polygonId]!;
setState(() {
polygons[polygonId] = polygon.copyWith(holesParam: _createHoles(polygonId));
polygons[polygonId] =
polygon.copyWith(holesParam: _createHoles(polygonId));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class GoogleMapController {
@visibleForTesting
MethodChannel? get channel {
if (GoogleMapsFlutterPlatform.instance is MethodChannelGoogleMapsFlutter) {
return (GoogleMapsFlutterPlatform.instance as MethodChannelGoogleMapsFlutter)
return (GoogleMapsFlutterPlatform.instance
as MethodChannelGoogleMapsFlutter)
.channel(mapId);
}
return null;
Expand Down Expand Up @@ -97,8 +98,8 @@ class GoogleMapController {
/// The returned [Future] completes after listeners have been notified.
Future<void> _updateMapOptions(Map<String, dynamic> optionsUpdate) {
assert(optionsUpdate != null);
return GoogleMapsFlutterPlatform.instance.updateMapOptions(optionsUpdate,
mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.updateMapOptions(optionsUpdate, mapId: mapId);
}

/// Updates marker configuration.
Expand All @@ -109,8 +110,8 @@ class GoogleMapController {
/// The returned [Future] completes after listeners have been notified.
Future<void> _updateMarkers(MarkerUpdates markerUpdates) {
assert(markerUpdates != null);
return GoogleMapsFlutterPlatform.instance.updateMarkers(markerUpdates,
mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.updateMarkers(markerUpdates, mapId: mapId);
}

/// Updates polygon configuration.
Expand All @@ -121,8 +122,8 @@ class GoogleMapController {
/// The returned [Future] completes after listeners have been notified.
Future<void> _updatePolygons(PolygonUpdates polygonUpdates) {
assert(polygonUpdates != null);
return GoogleMapsFlutterPlatform.instance.updatePolygons(polygonUpdates,
mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.updatePolygons(polygonUpdates, mapId: mapId);
}

/// Updates polyline configuration.
Expand All @@ -133,8 +134,8 @@ class GoogleMapController {
/// The returned [Future] completes after listeners have been notified.
Future<void> _updatePolylines(PolylineUpdates polylineUpdates) {
assert(polylineUpdates != null);
return GoogleMapsFlutterPlatform.instance.updatePolylines(polylineUpdates,
mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.updatePolylines(polylineUpdates, mapId: mapId);
}

/// Updates circle configuration.
Expand All @@ -145,8 +146,8 @@ class GoogleMapController {
/// The returned [Future] completes after listeners have been notified.
Future<void> _updateCircles(CircleUpdates circleUpdates) {
assert(circleUpdates != null);
return GoogleMapsFlutterPlatform.instance.updateCircles(circleUpdates,
mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.updateCircles(circleUpdates, mapId: mapId);
}

/// Updates tile overlays configuration.
Expand All @@ -156,8 +157,8 @@ class GoogleMapController {
///
/// The returned [Future] completes after listeners have been notified.
Future<void> _updateTileOverlays(Set<TileOverlay> newTileOverlays) {
return GoogleMapsFlutterPlatform.instance.updateTileOverlays(
newTileOverlays: newTileOverlays, mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.updateTileOverlays(newTileOverlays: newTileOverlays, mapId: mapId);
}

/// Clears the tile cache so that all tiles will be requested again from the
Expand All @@ -169,24 +170,26 @@ class GoogleMapController {
/// should implement an on-disk cache.
Future<void> clearTileCache(TileOverlayId tileOverlayId) async {
assert(tileOverlayId != null);
return GoogleMapsFlutterPlatform.instance.clearTileCache(tileOverlayId,
mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.clearTileCache(tileOverlayId, mapId: mapId);
}

/// Starts an animated change of the map camera position.
///
/// The returned [Future] completes after the change has been started on the
/// platform side.
Future<void> animateCamera(CameraUpdate cameraUpdate) {
return GoogleMapsFlutterPlatform.instance.animateCamera(cameraUpdate, mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.animateCamera(cameraUpdate, mapId: mapId);
}

/// Changes the map camera position.
///
/// The returned [Future] completes after the change has been made on the
/// platform side.
Future<void> moveCamera(CameraUpdate cameraUpdate) {
return GoogleMapsFlutterPlatform.instance.moveCamera(cameraUpdate, mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.moveCamera(cameraUpdate, mapId: mapId);
}

/// Sets the styling of the base map.
Expand All @@ -203,7 +206,8 @@ class GoogleMapController {
/// and [Android](https://developers.google.com/maps/documentation/android-sdk/style-reference)
/// style reference for more information regarding the supported styles.
Future<void> setMapStyle(String? mapStyle) {
return GoogleMapsFlutterPlatform.instance.setMapStyle(mapStyle, mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.setMapStyle(mapStyle, mapId: mapId);
}

/// Return [LatLngBounds] defining the region that is visible in a map.
Expand All @@ -217,15 +221,17 @@ class GoogleMapController {
/// Screen location is in screen pixels (not display pixels) with respect to the top left corner
/// of the map, not necessarily of the whole screen.
Future<ScreenCoordinate> getScreenCoordinate(LatLng latLng) {
return GoogleMapsFlutterPlatform.instance.getScreenCoordinate(latLng, mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.getScreenCoordinate(latLng, mapId: mapId);
}

/// Returns [LatLng] corresponding to the [ScreenCoordinate] in the current map view.
///
/// Returned [LatLng] corresponds to a screen location. The screen location is specified in screen
/// pixels (not display pixels) relative to the top left of the map, not top left of the whole screen.
Future<LatLng> getLatLng(ScreenCoordinate screenCoordinate) {
return GoogleMapsFlutterPlatform.instance.getLatLng(screenCoordinate, mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.getLatLng(screenCoordinate, mapId: mapId);
}

/// Programmatically show the Info Window for a [Marker].
Expand All @@ -238,8 +244,8 @@ class GoogleMapController {
/// * [isMarkerInfoWindowShown] to check if the Info Window is showing.
Future<void> showMarkerInfoWindow(MarkerId markerId) {
assert(markerId != null);
return GoogleMapsFlutterPlatform.instance.showMarkerInfoWindow(markerId,
mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.showMarkerInfoWindow(markerId, mapId: mapId);
}

/// Programmatically hide the Info Window for a [Marker].
Expand All @@ -252,8 +258,8 @@ class GoogleMapController {
/// * [isMarkerInfoWindowShown] to check if the Info Window is showing.
Future<void> hideMarkerInfoWindow(MarkerId markerId) {
assert(markerId != null);
return GoogleMapsFlutterPlatform.instance.hideMarkerInfoWindow(markerId,
mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.hideMarkerInfoWindow(markerId, mapId: mapId);
}

/// Returns `true` when the [InfoWindow] is showing, `false` otherwise.
Expand All @@ -266,8 +272,8 @@ class GoogleMapController {
/// * [hideMarkerInfoWindow] to hide the Info Window.
Future<bool> isMarkerInfoWindowShown(MarkerId markerId) {
assert(markerId != null);
return GoogleMapsFlutterPlatform.instance.isMarkerInfoWindowShown(markerId,
mapId: mapId);
return GoogleMapsFlutterPlatform.instance
.isMarkerInfoWindowShown(markerId, mapId: mapId);
}

/// Returns the current zoom level of the map
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ class FakePlatformGoogleMap {
}
final List<dynamic> markersData = markers;
final Set<Marker> result = <Marker>{};
for (Map<dynamic, dynamic> markerData in markersData.cast<Map<dynamic, dynamic>>()) {
for (Map<dynamic, dynamic> markerData
in markersData.cast<Map<dynamic, dynamic>>()) {
final String markerId = markerData['markerId'];
final double alpha = markerData['alpha'];
final bool draggable = markerData['draggable'];
Expand Down Expand Up @@ -191,7 +192,8 @@ class FakePlatformGoogleMap {
}
final List<dynamic> polygonsData = polygons;
final Set<Polygon> result = <Polygon>{};
for (Map<dynamic, dynamic> polygonData in polygonsData.cast<Map<dynamic, dynamic>>()) {
for (Map<dynamic, dynamic> polygonData
in polygonsData.cast<Map<dynamic, dynamic>>()) {
final String polygonId = polygonData['polygonId'];
final bool visible = polygonData['visible'];
final bool geodesic = polygonData['geodesic'];
Expand Down Expand Up @@ -250,7 +252,8 @@ class FakePlatformGoogleMap {
}
final List<dynamic> polylinesData = polylines;
final Set<Polyline> result = <Polyline>{};
for (Map<dynamic, dynamic> polylineData in polylinesData.cast<Map<dynamic, dynamic>>()) {
for (Map<dynamic, dynamic> polylineData
in polylinesData.cast<Map<dynamic, dynamic>>()) {
final String polylineId = polylineData['polylineId'];
final bool visible = polylineData['visible'];
final bool geodesic = polylineData['geodesic'];
Expand Down Expand Up @@ -315,7 +318,8 @@ class FakePlatformGoogleMap {
}
final List<dynamic> circlesData = circles;
final Set<Circle> result = <Circle>{};
for (Map<dynamic, dynamic> circleData in circlesData.cast<Map<dynamic, dynamic>>()) {
for (Map<dynamic, dynamic> circleData
in circlesData.cast<Map<dynamic, dynamic>>()) {
final String circleId = circleData['circleId'];
final bool visible = circleData['visible'];
final double radius = circleData['radius'];
Expand Down