moveAnimatedRaw method
void
moveAnimatedRaw(})
Animated movement of the map. The raw method allows to set all parameters.
Implementation
void moveAnimatedRaw(
LatLng newCenter,
double newZoom, {
Offset offset = Offset.zero,
required Duration duration,
required Curve curve,
required bool hasGesture,
required MapEventSource source,
}) {
// cancel all ongoing animation
_animationController.stop();
_resetAnimations();
if (newCenter == camera.center && newZoom == camera.zoom) return;
// create the new animation
_moveAnimation = LatLngTween(begin: camera.center, end: newCenter)
.chain(CurveTween(curve: curve))
.animate(_animationController);
_zoomAnimation = Tween<double>(begin: camera.zoom, end: newZoom)
.chain(CurveTween(curve: curve))
.animate(_animationController);
_animationController.duration = duration;
_animationHasGesture = hasGesture;
_animationOffset = offset;
// start the animation from its start
_animationController.forward(from: 0);
}