Refine milky Dock and refract symbols beneath the moving lens
This commit is contained in:
@@ -11,6 +11,36 @@ import 'navigation_test.dart' show uiController;
|
||||
|
||||
void main() {
|
||||
setUpAll(tzdata.initializeTimeZones);
|
||||
testWidgets(
|
||||
'moving lens refracts symbols above the icon row and releases cleanly',
|
||||
(tester) async {
|
||||
await tester.pumpWidget(_dock());
|
||||
await tester.pumpAndSettle();
|
||||
final optical = find.byKey(const ValueKey('dock-symbol-refraction'));
|
||||
expect(optical, findsNothing);
|
||||
final gesture = await tester.startGesture(
|
||||
tester.getCenter(find.byKey(const Key('dock-cursor'))),
|
||||
);
|
||||
await gesture.moveBy(const Offset(24, 0));
|
||||
await tester.pump();
|
||||
await gesture.moveBy(const Offset(54, 0));
|
||||
await tester.pump(const Duration(milliseconds: 120));
|
||||
expect(optical, findsOneWidget);
|
||||
final filter = tester.widget<GlassRefraction>(
|
||||
find.descendant(of: optical, matching: find.byType(GlassRefraction)),
|
||||
);
|
||||
expect(filter.strength, greaterThan(0.35));
|
||||
expect(filter.blurSigma, 0); // Keep the transmitted symbols legible.
|
||||
final stack = tester.widget<Stack>(
|
||||
find.ancestor(of: optical, matching: find.byType(Stack)).first,
|
||||
);
|
||||
expect(stack.children.last.key, const ValueKey('dock-symbol-refraction'));
|
||||
await gesture.up();
|
||||
await tester.pumpAndSettle();
|
||||
expect(optical, findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
},
|
||||
);
|
||||
testWidgets('edge overflow respects the actual dock parent and safe insets', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user