@@ -3605,6 +3605,62 @@ void main() {
36053605 expect (inkFeatures, paints..circle (color: Colors .transparent));
36063606 }, skip: kIsWeb && ! isCanvasKit); // https://github.com/flutter/flutter/issues/99933
36073607
3608+ testWidgets ('NavigationRail can scroll in low height' , (WidgetTester tester) async {
3609+ // This is a regression test for https://github.com/flutter/flutter/issues/89167.
3610+ await tester.pumpWidget (
3611+ MaterialApp (
3612+ theme: ThemeData (
3613+ useMaterial3: true ,
3614+ ),
3615+ home: Builder (
3616+ builder: (BuildContext context) {
3617+ return MediaQuery (
3618+ // Set Screen height with 300
3619+ data: MediaQuery .of (context).copyWith (size: const Size (800 , 300 )),
3620+ child: Scaffold (
3621+ body: Row (
3622+ children: < Widget > [
3623+ // Set NavigationRail height with 100
3624+ SizedBox (
3625+ height: 100 ,
3626+ child: NavigationRail (
3627+ selectedIndex: 0 ,
3628+ destinations: const < NavigationRailDestination > [
3629+ NavigationRailDestination (
3630+ icon: Icon (Icons .favorite_border),
3631+ selectedIcon: Icon (Icons .favorite),
3632+ label: Text ('Abc' ),
3633+ ),
3634+ NavigationRailDestination (
3635+ icon: Icon (Icons .bookmark_border),
3636+ selectedIcon: Icon (Icons .bookmark),
3637+ label: Text ('Def' ),
3638+ ),
3639+ NavigationRailDestination (
3640+ icon: Icon (Icons .star_border),
3641+ selectedIcon: Icon (Icons .star),
3642+ label: Text ('Ghi' ),
3643+ ),
3644+ ],
3645+ ),
3646+ ),
3647+ const Expanded (
3648+ child: Text ('body' ),
3649+ ),
3650+ ],
3651+ ),
3652+ ),
3653+ );
3654+ },
3655+ ),
3656+ ),
3657+ );
3658+
3659+ final ScrollableState scrollable = tester.state (find.byType (Scrollable ));
3660+ scrollable.position.jumpTo (500.0 );
3661+ expect (scrollable.position.pixels, equals (500.0 ));
3662+ });
3663+
36083664 group ('Material 2' , () {
36093665 // These tests are only relevant for Material 2. Once Material 2
36103666 // support is deprecated and the APIs are removed, these tests
@@ -5433,31 +5489,34 @@ TestSemantics _expectedSemantics() {
54335489 flags: < SemanticsFlag > [SemanticsFlag .scopesRoute],
54345490 children: < TestSemantics > [
54355491 TestSemantics (
5436- flags: < SemanticsFlag > [
5437- SemanticsFlag .isSelected,
5438- SemanticsFlag .isFocusable,
5492+ flags: < SemanticsFlag > [SemanticsFlag .hasImplicitScrolling],
5493+ children: < TestSemantics > [
5494+ TestSemantics (
5495+ flags: < SemanticsFlag > [SemanticsFlag .isSelected,
5496+ SemanticsFlag .isFocusable],
5497+ actions: < SemanticsAction > [SemanticsAction .tap],
5498+ label: 'Abc\n Tab 1 of 4' ,
5499+ textDirection: TextDirection .ltr,
5500+ ),
5501+ TestSemantics (
5502+ flags: < SemanticsFlag > [SemanticsFlag .isFocusable],
5503+ actions: < SemanticsAction > [SemanticsAction .tap],
5504+ label: 'Def\n Tab 2 of 4' ,
5505+ textDirection: TextDirection .ltr,
5506+ ),
5507+ TestSemantics (
5508+ flags: < SemanticsFlag > [SemanticsFlag .isFocusable],
5509+ actions: < SemanticsAction > [SemanticsAction .tap],
5510+ label: 'Ghi\n Tab 3 of 4' ,
5511+ textDirection: TextDirection .ltr,
5512+ ),
5513+ TestSemantics (
5514+ flags: < SemanticsFlag > [SemanticsFlag .isFocusable],
5515+ actions: < SemanticsAction > [SemanticsAction .tap],
5516+ label: 'Jkl\n Tab 4 of 4' ,
5517+ textDirection: TextDirection .ltr,
5518+ ),
54395519 ],
5440- actions: < SemanticsAction > [SemanticsAction .tap],
5441- label: 'Abc\n Tab 1 of 4' ,
5442- textDirection: TextDirection .ltr,
5443- ),
5444- TestSemantics (
5445- flags: < SemanticsFlag > [SemanticsFlag .isFocusable],
5446- actions: < SemanticsAction > [SemanticsAction .tap],
5447- label: 'Def\n Tab 2 of 4' ,
5448- textDirection: TextDirection .ltr,
5449- ),
5450- TestSemantics (
5451- flags: < SemanticsFlag > [SemanticsFlag .isFocusable],
5452- actions: < SemanticsAction > [SemanticsAction .tap],
5453- label: 'Ghi\n Tab 3 of 4' ,
5454- textDirection: TextDirection .ltr,
5455- ),
5456- TestSemantics (
5457- flags: < SemanticsFlag > [SemanticsFlag .isFocusable],
5458- actions: < SemanticsAction > [SemanticsAction .tap],
5459- label: 'Jkl\n Tab 4 of 4' ,
5460- textDirection: TextDirection .ltr,
54615520 ),
54625521 TestSemantics (
54635522 label: 'body' ,
0 commit comments