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:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/ui/motion/motion.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/floating_destination_bar.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/glass_pill.dart';
|
||||
|
||||
@@ -128,7 +129,12 @@ void main() {
|
||||
isA<CircleBorder>(),
|
||||
);
|
||||
final icon = tester.getRect(find.byIcon(icons[index]));
|
||||
expect(icon.size, Size(iconSize, iconSize));
|
||||
// Tab 0 is selected: its icon is a little larger than the others.
|
||||
final side = index == 0
|
||||
? iconSize * Motion.tabSelectedIconScale
|
||||
: iconSize;
|
||||
expect(icon.width, moreOrLessEquals(side));
|
||||
expect(icon.height, moreOrLessEquals(side));
|
||||
expect(icon.center, circle.center);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user