Skip to content

Commit dc7da2b

Browse files
authored
Make sure that a Scrollbar doesn't crash in 0x0 environment (flutter#177724)
This is my attempt to handle flutter#6537 for the Scrollbar widget.
1 parent 7efa2ae commit dc7da2b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/flutter/test/material/scrollbar_test.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,4 +1755,15 @@ The provided ScrollController cannot be shared by multiple ScrollView widgets.''
17551755

17561756
scrollController.dispose();
17571757
});
1758+
1759+
testWidgets('Scrollbar does not crash at zero area', (WidgetTester tester) async {
1760+
await tester.pumpWidget(
1761+
const MaterialApp(
1762+
home: Center(
1763+
child: SizedBox.shrink(child: Scrollbar(child: SingleChildScrollView())),
1764+
),
1765+
),
1766+
);
1767+
expect(tester.getSize(find.byType(Scrollbar)), Size.zero);
1768+
});
17581769
}

0 commit comments

Comments
 (0)