File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -683,7 +683,7 @@ class DrawerControllerState extends State<DrawerController> with SingleTickerPro
683683 @override
684684 Widget build (BuildContext context) {
685685 assert (debugCheckHasMaterialLocalizations (context));
686- return ListTileTheme (
686+ return ListTileTheme . merge (
687687 style: ListTileStyle .drawer,
688688 child: _buildDrawer (context),
689689 );
Original file line number Diff line number Diff line change @@ -444,4 +444,37 @@ void main() {
444444
445445 expect (find.byType (Material ), paints..path (color: selectedTileColor));
446446 });
447+
448+ testWidgets ('ListTile uses ListTileTheme shape in a drawer' , (WidgetTester tester) async {
449+ // This is a regression test for https://github.com/flutter/flutter/issues/106303
450+
451+ final GlobalKey <ScaffoldState > scaffoldKey = GlobalKey <ScaffoldState >();
452+ final ShapeBorder shapeBorder = RoundedRectangleBorder (borderRadius: BorderRadius .circular (20.0 ));
453+
454+ await tester.pumpWidget (MaterialApp (
455+ theme: ThemeData (
456+ listTileTheme: ListTileThemeData (shape: shapeBorder),
457+ ),
458+ home: Scaffold (
459+ key: scaffoldKey,
460+ drawer: const Drawer (
461+ child: ListTile (),
462+ ),
463+ body: Container (),
464+ ),
465+ ));
466+ await tester.pumpAndSettle ();
467+
468+ scaffoldKey.currentState! .openDrawer ();
469+ // Start drawer animation.
470+ await tester.pump ();
471+
472+ final ShapeBorder ? inkWellBorder = tester.widget <InkWell >(
473+ find.descendant (
474+ of: find.byType (ListTile ),
475+ matching: find.byType (InkWell ),
476+ )).customBorder;
477+ // Test shape.
478+ expect (inkWellBorder, shapeBorder);
479+ });
447480}
You can’t perform that action at this time.
0 commit comments