flingAnimatedRaw method
void
flingAnimatedRaw({})
Fling animation for the map. The raw method allows to set all parameters.
Implementation
void flingAnimatedRaw({
required double velocity,
required Offset direction,
required Offset begin,
Offset offset = Offset.zero,
double mass = 1,
double stiffness = 1000,
double ratio = 5,
required bool hasGesture,
}) {
// cancel all ongoing animation
_animationController.stop();
_resetAnimations();
_animationHasGesture = hasGesture;
_animationOffset = offset;
_flingMapCenterStartPoint = camera.projectAtZoom(camera.center);
final distance = (Offset.zero & camera.nonRotatedSize).shortestSide;
_flingAnimation = Tween<Offset>(
begin: begin,
end: begin - direction * distance,
).animate(_animationController);
_animationController.value = 0;
_animationController.fling(
velocity: velocity,
springDescription: SpringDescription.withDampingRatio(
mass: mass,
stiffness: stiffness,
ratio: ratio,
),
);
}