Refine milky Dock and refract symbols beneath the moving lens

This commit is contained in:
david1465833828
2026-10-28 17:56:40 +08:00
parent dc71e411e9
commit 23c1a58ca3
10 changed files with 351 additions and 160 deletions
+30
View File
@@ -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 {