deformationAmplitude method
Amplitude (0..1) of decorative deformation for a given transition
progress, clamped to maxStretch/maxCompression. Never read this
as a layout fraction — it is for a bounded, localized visual transform
only (see the class doc).
Implementation
double deformationAmplitude(double progress) {
final p = progress.clamp(0.0, 1.0);
final rising = p < 0.5 ? p * 2 : (1 - p) * 2;
final amplitude = rising.clamp(0.0, 1.0) * (maxStretch + maxCompression);
return amplitude.clamp(0.0, maxStretch + maxCompression);
}