fix(nav,favoritos): unclip the overflow menu and smooth the tab transition
Two user-reported bugs from on-device testing. The favourites overflow menu carried `constraints: tightFor(38x42)`, which sizes the POPUP rather than the button -- every item was clipped to its first letter, so users saw "M" and "E" instead of the labels. The existing test passed throughout because find.text matches a Text widget whether or not it is visually clipped; the new guard measures the laid-out width instead. The bottom bar's ink splash had no shape, painting a hard square over the icon, and the active tab's lift, dim, icon size and label all changed instantly while the balloon slid -- the balloon glided and its contents teleported. All four now share the balloon's duration and curve.
This commit is contained in:
@@ -472,6 +472,24 @@ void main() {
|
||||
expect(find.text('Move to list'), findsOneWidget);
|
||||
expect(find.text('Remove from favorites'), findsOneWidget);
|
||||
expect(find.byType(PopupMenuItem<String>), findsNWidgets(2));
|
||||
|
||||
// Regression guard for a real user-reported bug: the button carried
|
||||
// `constraints: BoxConstraints.tightFor(width: 38, height: 42)`,
|
||||
// which sizes the POPUP MENU rather than the button. Every item was
|
||||
// clipped to its first letter — users saw "M" and "E", not the
|
||||
// labels. The three assertions above all PASSED throughout, because
|
||||
// find.text matches a Text widget in the tree whether or not it is
|
||||
// visually clipped. Only measuring the laid-out width catches it.
|
||||
final anchoItem = tester.getSize(
|
||||
find.byType(PopupMenuItem<String>).first,
|
||||
);
|
||||
expect(
|
||||
anchoItem.width,
|
||||
greaterThan(100),
|
||||
reason:
|
||||
'a menu item narrower than its label means the popup is being '
|
||||
'constrained and the text is clipped',
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -96,13 +96,17 @@ void main() {
|
||||
);
|
||||
expect(inactiveIcon.color, isNull);
|
||||
|
||||
final dimmed = tester.widget<Opacity>(
|
||||
// AnimatedOpacity, not a plain Opacity: the dim now transitions with the
|
||||
// balloon instead of snapping. Users reported the bar's contents
|
||||
// teleporting while the balloon slid — the lift, dim, icon size and
|
||||
// label all animate together now.
|
||||
final dimmed = tester.widget<AnimatedOpacity>(
|
||||
find.ancestor(
|
||||
of: find.descendant(
|
||||
of: find.byKey(PluriBottomNavigation.itemKey(1)),
|
||||
matching: find.byType(PluriIcon),
|
||||
),
|
||||
matching: find.byType(Opacity),
|
||||
matching: find.byType(AnimatedOpacity),
|
||||
),
|
||||
);
|
||||
expect(dimmed.opacity, closeTo(0.46, 0.001));
|
||||
|
||||
Reference in New Issue
Block a user