CupertinoSliverNavigationBar.search fidelity updates (#163089)
## Native iOS overlaid on Flutter view | Inactive search state | Active search state | | --- | --- | | <img alt="Screenshot 2025-02-11 at 3 31 40 PM" src="https://github.com/user-attachments/assets/eefa539e-8e78-4047-8876-c16db26f59df" /> | <img alt="Screenshot 2025-02-11 at 3 34 01 PM" src="https://github.com/user-attachments/assets/2b4b9a20-5a99-493d-b343-ac38b039efa7" /> | Animation curve and duration values gotten from xcode. Addresses some of the issues in https://github.com/flutter/flutter/issues/163020
This commit is contained in:
@@ -39,8 +39,8 @@ void main() {
|
||||
// Middle, large title, and search field are visible.
|
||||
expect(tester.getBottomLeft(find.text('Contacts Group').first).dy, 30.5);
|
||||
expect(tester.getBottomLeft(find.text('Family').first).dy, 88.0);
|
||||
expect(tester.getTopLeft(find.byType(CupertinoSearchTextField)).dy, 104.0);
|
||||
expect(tester.getBottomLeft(find.byType(CupertinoSearchTextField)).dy, 139.0);
|
||||
expect(tester.getTopLeft(find.byType(CupertinoSearchTextField)).dy, 96.0);
|
||||
expect(tester.getBottomLeft(find.byType(CupertinoSearchTextField)).dy, 132.0);
|
||||
|
||||
await tester.fling(find.text('Drag me up'), bottomDragUp, 50.0);
|
||||
await tester.pumpAndSettle();
|
||||
@@ -48,8 +48,8 @@ void main() {
|
||||
// Search field is hidden, but large title and middle title are visible.
|
||||
expect(tester.getBottomLeft(find.text('Contacts Group').first).dy, 30.5);
|
||||
expect(tester.getBottomLeft(find.text('Family').first).dy, 88.0);
|
||||
expect(tester.getTopLeft(find.byType(CupertinoSearchTextField)).dy, 104.0);
|
||||
expect(tester.getBottomLeft(find.byType(CupertinoSearchTextField)).dy, 104.0);
|
||||
expect(tester.getTopLeft(find.byType(CupertinoSearchTextField)).dy, 96.0);
|
||||
expect(tester.getBottomLeft(find.byType(CupertinoSearchTextField)).dy, 96.0);
|
||||
|
||||
await tester.fling(find.text('Drag me up'), titleDragUp, 50.0);
|
||||
await tester.pumpAndSettle();
|
||||
@@ -60,7 +60,7 @@ void main() {
|
||||
tester.getBottomLeft(find.text('Family').first).dy,
|
||||
36.0 + 8.0,
|
||||
); // Static part + _kNavBarBottomPadding.
|
||||
expect(tester.getBottomLeft(find.byType(CupertinoSearchTextField)).dy, 52.0);
|
||||
expect(tester.getBottomLeft(find.byType(CupertinoSearchTextField)).dy, 44.0);
|
||||
});
|
||||
|
||||
testWidgets('Search field is always shown in bottom always mode', (WidgetTester tester) async {
|
||||
@@ -75,8 +75,8 @@ void main() {
|
||||
// Middle, large title, and search field are visible.
|
||||
expect(tester.getBottomLeft(find.text('Contacts Group').first).dy, 30.5);
|
||||
expect(tester.getBottomLeft(find.text('Family').first).dy, 88.0);
|
||||
expect(tester.getTopLeft(find.byType(CupertinoSearchTextField)).dy, 104.0);
|
||||
expect(tester.getBottomLeft(find.byType(CupertinoSearchTextField)).dy, 139.0);
|
||||
expect(tester.getTopLeft(find.byType(CupertinoSearchTextField)).dy, 96.0);
|
||||
expect(tester.getBottomLeft(find.byType(CupertinoSearchTextField)).dy, 132.0);
|
||||
|
||||
await tester.fling(find.text('Drag me up'), titleDragUp, 50.0);
|
||||
await tester.pumpAndSettle();
|
||||
@@ -87,8 +87,8 @@ void main() {
|
||||
tester.getBottomLeft(find.text('Family').first).dy,
|
||||
36.0 + 8.0,
|
||||
); // Static part + _kNavBarBottomPadding.
|
||||
expect(tester.getTopLeft(find.byType(CupertinoSearchTextField)).dy, 52.0);
|
||||
expect(tester.getBottomLeft(find.byType(CupertinoSearchTextField)).dy, 87.0);
|
||||
expect(tester.getTopLeft(find.byType(CupertinoSearchTextField)).dy, 44.0);
|
||||
expect(tester.getBottomLeft(find.byType(CupertinoSearchTextField)).dy, 80.0);
|
||||
});
|
||||
|
||||
testWidgets('Opens the search view when the search field is tapped', (WidgetTester tester) async {
|
||||
|
||||
Reference in New Issue
Block a user