Tabs: the selected tab's icon is a little larger

The selected icon grows to 1.15x with the selection tint (220 ms, same curve)
and shrinks back when another tab is selected, on every floating tab bar;
reduced motion jumps straight to the size.
This commit is contained in:
2026-11-02 21:57:26 +00:00
parent badf858124
commit 6fcdbcaec2
4 changed files with 30 additions and 3 deletions
@@ -156,6 +156,11 @@ class FloatingTabButton extends StatelessWidget {
),
child: FloatingTabBounce(motion: motion, index: index, child: icon),
);
// The selected icon is a little larger, growing with the selection.
glyph = Transform.scale(
scale: 1 + (Motion.tabSelectedIconScale - 1) * t,
child: glyph,
);
final reveal = GlassReveal.maybeOf(context);
if (reveal != null) {
// The icon sits above the glass, so it fades with it here.
+4
View File
@@ -43,6 +43,10 @@ abstract final class Motion {
/// The icon's scale at the top of its bounce.
static const double tabBounceScale = 1.08;
/// How much larger the selected tab's icon is than the others; it grows
/// and shrinks with the selection tint.
static const double tabSelectedIconScale = 1.15;
/// Duration of each top-bar island's entrance pop (Back, title, actions).
static const Duration barEntranceDuration = Duration(milliseconds: 240);