Skip to content

Instantly share code, notes, and snippets.

@moho12n
Created June 14, 2020 21:09
Show Gist options
  • Save moho12n/ee81bb63376075f288118c2222df98d5 to your computer and use it in GitHub Desktop.
Save moho12n/ee81bb63376075f288118c2222df98d5 to your computer and use it in GitHub Desktop.
onPageChanged: (int index) {
setState(() => _index = index);
indexMarker = Tools.markersList[index].id;
if (Tools.markersList[index].latitude != null &&
Tools.markersList[index].longitude != null) {
newPosition = LatLng(
double.tryParse(
Tools.markersList[index].latitude),
double.tryParse(
Tools.markersList[index].longitude));
newCameraPosition =
CameraPosition(target: newPosition, zoom: 15);
}
getMarkers();
mapController
.animateCamera(CameraUpdate.newCameraPosition(
newCameraPosition))
.then((val) {
setState(() {});
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment