INNER CODE UNIT · Dart
angle
Klerith/animate_do_package · lib/src/custom_animation/move_to_arc.dart:58
final double angle = t * pi / 2;
final double verticalRadius = widget.bottom - widget.top;
final double horizontalDelta = widget.right - widget.left;
final double offsetY = widget.upward
? -verticalRadius.abs() * sin(angle)
: verticalRadius * (1 - cos(angle));
final double offsetX = horizontalDelta * t;
return Transform.translate(
offset: Offset(offsetX, offsetY),
child: child,
);
}
}