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
683
683
@override
684
684
Widget build (BuildContext context) {
685
685
assert (debugCheckHasMaterialLocalizations (context));
686
- return ListTileTheme (
686
+ return ListTileTheme . merge (
687
687
style: ListTileStyle .drawer,
688
688
child: _buildDrawer (context),
689
689
);
Original file line number Diff line number Diff line change @@ -444,4 +444,37 @@ void main() {
444
444
445
445
expect (find.byType (Material ), paints..path (color: selectedTileColor));
446
446
});
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
+ });
447
480
}
You can’t perform that action at this time.
0 commit comments