@@ -1789,6 +1789,50 @@ void main() {
1789
1789
expect (searchViewRect.topLeft, equals (const Offset (rootSpacing, rootSpacing)));
1790
1790
});
1791
1791
1792
+ testWidgets ('Docked search view with nested navigator does not go off the screen' , (WidgetTester tester) async {
1793
+ addTearDown (tester.view.reset);
1794
+ tester.view.physicalSize = const Size (400.0 , 400.0 );
1795
+ tester.view.devicePixelRatio = 1.0 ;
1796
+
1797
+ const double rootSpacing = 100.0 ;
1798
+
1799
+ await tester.pumpWidget (MaterialApp (
1800
+ builder: (BuildContext context, Widget ? child) {
1801
+ return Scaffold (
1802
+ body: Padding (
1803
+ padding: const EdgeInsets .all (rootSpacing),
1804
+ child: child,
1805
+ ),
1806
+ );
1807
+ },
1808
+ home: Material (
1809
+ child: Align (
1810
+ alignment: Alignment .bottomRight,
1811
+ child: SearchAnchor (
1812
+ isFullScreen: false ,
1813
+ builder: (BuildContext context, SearchController controller) {
1814
+ return IconButton (
1815
+ icon: const Icon (Icons .search),
1816
+ onPressed: () {
1817
+ controller.openView ();
1818
+ },
1819
+ );
1820
+ },
1821
+ suggestionsBuilder: (BuildContext context, SearchController controller) {
1822
+ return < Widget > [];
1823
+ },
1824
+ ),
1825
+ ),
1826
+ ),
1827
+ ));
1828
+
1829
+ await tester.tap (find.byIcon (Icons .search));
1830
+ await tester.pumpAndSettle ();
1831
+
1832
+ final Rect searchViewRect = tester.getRect (find.descendant (of: findViewContent (), matching: find.byType (SizedBox )).first);
1833
+ expect (searchViewRect.bottomRight, equals (const Offset (300.0 , 300.0 )));
1834
+ });
1835
+
1792
1836
1793
1837
// Regression tests for https://github.com/flutter/flutter/issues/126623
1794
1838
group ('Overall InputDecorationTheme does not impact SearchBar and SearchView' , () {
0 commit comments