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
Fix incorrect 'late's
  • Loading branch information
stuartmorgan-g committed Feb 16, 2021
commit 6bc0a2f76ce6e7818f68dd3e49bd58a56dc94e6e
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AnimateCamera extends StatefulWidget {
}

class AnimateCameraState extends State<AnimateCamera> {
late GoogleMapController mapController;
GoogleMapController? mapController;

void _onMapCreated(GoogleMapController controller) {
mapController = controller;
Expand Down Expand Up @@ -56,7 +56,7 @@ class AnimateCameraState extends State<AnimateCamera> {
children: <Widget>[
TextButton(
onPressed: () {
mapController.animateCamera(
mapController?.animateCamera(
CameraUpdate.newCameraPosition(
const CameraPosition(
bearing: 270.0,
Expand All @@ -71,7 +71,7 @@ class AnimateCameraState extends State<AnimateCamera> {
),
TextButton(
onPressed: () {
mapController.animateCamera(
mapController?.animateCamera(
CameraUpdate.newLatLng(
const LatLng(56.1725505, 10.1850512),
),
Expand All @@ -81,7 +81,7 @@ class AnimateCameraState extends State<AnimateCamera> {
),
TextButton(
onPressed: () {
mapController.animateCamera(
mapController?.animateCamera(
CameraUpdate.newLatLngBounds(
LatLngBounds(
southwest: const LatLng(-38.483935, 113.248673),
Expand All @@ -95,7 +95,7 @@ class AnimateCameraState extends State<AnimateCamera> {
),
TextButton(
onPressed: () {
mapController.animateCamera(
mapController?.animateCamera(
CameraUpdate.newLatLngZoom(
const LatLng(37.4231613, -122.087159),
11.0,
Expand All @@ -106,7 +106,7 @@ class AnimateCameraState extends State<AnimateCamera> {
),
TextButton(
onPressed: () {
mapController.animateCamera(
mapController?.animateCamera(
CameraUpdate.scrollBy(150.0, -225.0),
);
},
Expand All @@ -118,7 +118,7 @@ class AnimateCameraState extends State<AnimateCamera> {
children: <Widget>[
TextButton(
onPressed: () {
mapController.animateCamera(
mapController?.animateCamera(
CameraUpdate.zoomBy(
-0.5,
const Offset(30.0, 20.0),
Expand All @@ -129,31 +129,31 @@ class AnimateCameraState extends State<AnimateCamera> {
),
TextButton(
onPressed: () {
mapController.animateCamera(
mapController?.animateCamera(
CameraUpdate.zoomBy(-0.5),
);
},
child: const Text('zoomBy'),
),
TextButton(
onPressed: () {
mapController.animateCamera(
mapController?.animateCamera(
CameraUpdate.zoomIn(),
);
},
child: const Text('zoomIn'),
),
TextButton(
onPressed: () {
mapController.animateCamera(
mapController?.animateCamera(
CameraUpdate.zoomOut(),
);
},
child: const Text('zoomOut'),
),
TextButton(
onPressed: () {
mapController.animateCamera(
mapController?.animateCamera(
CameraUpdate.zoomTo(16.0),
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MoveCamera extends StatefulWidget {
}

class MoveCameraState extends State<MoveCamera> {
late GoogleMapController mapController;
GoogleMapController? mapController;

void _onMapCreated(GoogleMapController controller) {
mapController = controller;
Expand Down Expand Up @@ -55,7 +55,7 @@ class MoveCameraState extends State<MoveCamera> {
children: <Widget>[
TextButton(
onPressed: () {
mapController.moveCamera(
mapController?.moveCamera(
CameraUpdate.newCameraPosition(
const CameraPosition(
bearing: 270.0,
Expand All @@ -70,7 +70,7 @@ class MoveCameraState extends State<MoveCamera> {
),
TextButton(
onPressed: () {
mapController.moveCamera(
mapController?.moveCamera(
CameraUpdate.newLatLng(
const LatLng(56.1725505, 10.1850512),
),
Expand All @@ -80,7 +80,7 @@ class MoveCameraState extends State<MoveCamera> {
),
TextButton(
onPressed: () {
mapController.moveCamera(
mapController?.moveCamera(
CameraUpdate.newLatLngBounds(
LatLngBounds(
southwest: const LatLng(-38.483935, 113.248673),
Expand All @@ -94,7 +94,7 @@ class MoveCameraState extends State<MoveCamera> {
),
TextButton(
onPressed: () {
mapController.moveCamera(
mapController?.moveCamera(
CameraUpdate.newLatLngZoom(
const LatLng(37.4231613, -122.087159),
11.0,
Expand All @@ -105,7 +105,7 @@ class MoveCameraState extends State<MoveCamera> {
),
TextButton(
onPressed: () {
mapController.moveCamera(
mapController?.moveCamera(
CameraUpdate.scrollBy(150.0, -225.0),
);
},
Expand All @@ -117,7 +117,7 @@ class MoveCameraState extends State<MoveCamera> {
children: <Widget>[
TextButton(
onPressed: () {
mapController.moveCamera(
mapController?.moveCamera(
CameraUpdate.zoomBy(
-0.5,
const Offset(30.0, 20.0),
Expand All @@ -128,31 +128,31 @@ class MoveCameraState extends State<MoveCamera> {
),
TextButton(
onPressed: () {
mapController.moveCamera(
mapController?.moveCamera(
CameraUpdate.zoomBy(-0.5),
);
},
child: const Text('zoomBy'),
),
TextButton(
onPressed: () {
mapController.moveCamera(
mapController?.moveCamera(
CameraUpdate.zoomIn(),
);
},
child: const Text('zoomIn'),
),
TextButton(
onPressed: () {
mapController.moveCamera(
mapController?.moveCamera(
CameraUpdate.zoomOut(),
);
},
child: const Text('zoomOut'),
),
TextButton(
onPressed: () {
mapController.moveCamera(
mapController?.moveCamera(
CameraUpdate.zoomTo(16.0),
);
},
Expand Down