Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
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
Address final review feedback
  • Loading branch information
stuartmorgan-g committed Feb 17, 2021
commit a5598a97ede139c7923f29d35e016b8f4af06d51
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GoogleMap extends StatefulWidget {
Key? key,
required this.initialCameraPosition,
this.onMapCreated,
this.gestureRecognizers,
this.gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{},
this.compassEnabled = true,
this.mapToolbarEnabled = true,
this.cameraTargetBounds = CameraTargetBounds.unbounded,
Expand Down Expand Up @@ -227,9 +227,9 @@ class GoogleMap extends StatefulWidget {
/// vertical drags. The map will claim gestures that are recognized by any of the
/// recognizers on this list.
///
/// When this set is empty or null, the map will only handle pointer events for gestures that
/// When this set is empty, the map will only handle pointer events for gestures that
/// were not claimed by any other gesture recognizer.
final Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers;
final Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers;

/// Creates a [State] for this [GoogleMap].
@override
Expand Down Expand Up @@ -350,7 +350,7 @@ class _GoogleMapState extends State<GoogleMap> {
);
_controller.complete(controller);
_updateTileOverlays();
final onMapCreated = widget.onMapCreated;
final MapCreatedCallback? onMapCreated = widget.onMapCreated;
if (onMapCreated != null) {
onMapCreated(controller);
}
Expand All @@ -362,7 +362,7 @@ class _GoogleMapState extends State<GoogleMap> {
if (marker == null) {
throw UnknownMapObjectIdError('marker', markerId, 'onTap');
}
final onTap = marker.onTap;
final VoidCallback? onTap = marker.onTap;
if (onTap != null) {
onTap();
}
Expand All @@ -374,7 +374,7 @@ class _GoogleMapState extends State<GoogleMap> {
if (marker == null) {
throw UnknownMapObjectIdError('marker', markerId, 'onDragEnd');
}
final onDragEnd = marker.onDragEnd;
final ValueChanged<LatLng>? onDragEnd = marker.onDragEnd;
if (onDragEnd != null) {
onDragEnd(position);
}
Expand All @@ -386,7 +386,7 @@ class _GoogleMapState extends State<GoogleMap> {
if (polygon == null) {
throw UnknownMapObjectIdError('polygon', polygonId, 'onTap');
}
final onTap = polygon.onTap;
final VoidCallback? onTap = polygon.onTap;
if (onTap != null) {
onTap();
}
Expand All @@ -398,7 +398,7 @@ class _GoogleMapState extends State<GoogleMap> {
if (polyline == null) {
throw UnknownMapObjectIdError('polyline', polylineId, 'onTap');
}
final onTap = polyline.onTap;
final VoidCallback? onTap = polyline.onTap;
if (onTap != null) {
onTap();
}
Expand All @@ -410,7 +410,7 @@ class _GoogleMapState extends State<GoogleMap> {
if (circle == null) {
throw UnknownMapObjectIdError('marker', circleId, 'onTap');
}
final onTap = circle.onTap;
final VoidCallback? onTap = circle.onTap;
if (onTap != null) {
onTap();
}
Expand All @@ -422,23 +422,23 @@ class _GoogleMapState extends State<GoogleMap> {
if (marker == null) {
throw UnknownMapObjectIdError('marker', markerId, 'InfoWindow onTap');
}
final onTap = marker.infoWindow.onTap;
final VoidCallback? onTap = marker.infoWindow.onTap;
if (onTap != null) {
onTap();
}
}

void onTap(LatLng position) {
assert(position != null);
final onTap = widget.onTap;
final ArgumentCallback<LatLng>? onTap = widget.onTap;
if (onTap != null) {
onTap(position);
}
}

void onLongPress(LatLng position) {
assert(position != null);
final onLongPress = widget.onLongPress;
final ArgumentCallback<LatLng>? onLongPress = widget.onLongPress;
if (onLongPress != null) {
onLongPress(position);
}
Expand Down