morphElevation static method
Shadow elevation that peaks mid-transition for a lift effect.
At progress 0.0 → startElevation.
At progress 0.5 → peakElevation (highest).
At progress 1.0 → endElevation.
Implementation
static double morphElevation(
double progress, {
double startElevation = 4.0,
double peakElevation = 16.0,
double endElevation = 0.0,
}) {
final t = progress.clamp(0.0, 1.0);
if (t < 0.5) {
return lerpDouble(startElevation, peakElevation, t / 0.5)!;
} else {
return lerpDouble(peakElevation, endElevation, (t - 0.5) / 0.5)!;
}
}