down method
void
down({
- required SpringDescription spring,
- required double lead,
- double amplitude = 1,
- bool reduceMotion = false,
Presses the key to amplitude on the spring (pressIn), one
lead (seconds) ahead so the first frame moves. Snaps the tint on.
With reduceMotion, p jumps to amplitude and the tint fades in on
effectsFast instead (motion brief ยง2.2.5).
Implementation
void down({
required SpringDescription spring,
required double lead,
double amplitude = 1,
bool reduceMotion = false,
}) {
_down = true;
_releasePending = false;
_amplitude = amplitude;
_minElapsed = false;
_minPressTimer?.cancel();
_minPressTimer = Timer(CalcThemeData.minPress, _onMinPress);
if (reduceMotion) {
press.value = amplitude;
scale.value = amplitude;
tint.animateWith(
LeadSimulation(_spring(CalcThemeData.effectsFast, tint, 1), lead),
);
} else {
tint.value = 1;
press.animateWith(
LeadSimulation(_spring(spring, press, amplitude), lead),
);
scale.animateWith(
LeadSimulation(_spring(spring, scale, amplitude), lead),
);
}
}