Pop the top bar's islands in and give its controls press feedback
Each island (Back, title, actions pill, each action) scales in from 0.85 with a gentle overshoot, staggered from the leading edge on first show and at once when it newly appears; rebuilds and title changes keep it. Glass fades its fill and blur together so backdrop grouping is unchanged. Every tappable piece sinks to 0.94 under a stadium tint while pressed and springs back. Reduced motion skips the animation.
This commit is contained in:
@@ -47,6 +47,39 @@ abstract final class Motion {
|
||||
/// The icon's scale at the top of its bounce.
|
||||
static const double tabBounceScale = 1.08;
|
||||
|
||||
/// Duration of each top-bar island's entrance pop (Back, title, actions).
|
||||
static const Duration barEntranceDuration = Duration(milliseconds: 240);
|
||||
|
||||
/// Delay between neighbouring top-bar islands entering together, from the
|
||||
/// leading edge.
|
||||
static const Duration barEntranceStagger = Duration(milliseconds: 40);
|
||||
|
||||
/// The scale at which a top-bar island starts its entrance.
|
||||
static const double barEntranceScaleBegin = 0.85;
|
||||
|
||||
/// The fraction of an island's entrance spent fading in.
|
||||
static const double barEntranceOpacityPortion = 0.6;
|
||||
|
||||
/// The gentle overshoot of an island's entrance.
|
||||
static const Curve barEntranceCurve = Curves.easeOutBack;
|
||||
|
||||
/// How long a pressed top-bar control takes to sink.
|
||||
static const Duration barPressDuration = Duration(milliseconds: 90);
|
||||
|
||||
/// The scale of a top-bar control while it is held down.
|
||||
static const double barPressScale = 0.94;
|
||||
|
||||
/// The opacity of the pressed tint over a top-bar control.
|
||||
static const double barPressTintOpacity = 0.14;
|
||||
|
||||
/// The spring a released top-bar control returns on: quick, with a
|
||||
/// barely visible overshoot.
|
||||
static const SpringDescription barReleaseSpring = SpringDescription(
|
||||
mass: 1,
|
||||
stiffness: 520,
|
||||
damping: 28,
|
||||
);
|
||||
|
||||
static const Curve curve = Curves.easeOutCubic;
|
||||
|
||||
/// [duration], or zero under the system's reduce-motion setting.
|
||||
|
||||
Reference in New Issue
Block a user