Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
750516a1
Unverified
Commit
750516a1
authored
Jul 08, 2022
by
Taha Tesser
Committed by
GitHub
Jul 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix `ListTile` theme shape in a drawer (#106343)
parent
255b71f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
drawer.dart
packages/flutter/lib/src/material/drawer.dart
+1
-1
list_tile_theme_test.dart
packages/flutter/test/material/list_tile_theme_test.dart
+33
-0
No files found.
packages/flutter/lib/src/material/drawer.dart
View file @
750516a1
...
...
@@ -683,7 +683,7 @@ class DrawerControllerState extends State<DrawerController> with SingleTickerPro
@override
Widget
build
(
BuildContext
context
)
{
assert
(
debugCheckHasMaterialLocalizations
(
context
));
return
ListTileTheme
(
return
ListTileTheme
.
merge
(
style:
ListTileStyle
.
drawer
,
child:
_buildDrawer
(
context
),
);
...
...
packages/flutter/test/material/list_tile_theme_test.dart
View file @
750516a1
...
...
@@ -444,4 +444,37 @@ void main() {
expect
(
find
.
byType
(
Material
),
paints
..
path
(
color:
selectedTileColor
));
});
testWidgets
(
'ListTile uses ListTileTheme shape in a drawer'
,
(
WidgetTester
tester
)
async
{
// This is a regression test for https://github.com/flutter/flutter/issues/106303
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
GlobalKey
<
ScaffoldState
>();
final
ShapeBorder
shapeBorder
=
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
20.0
));
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
listTileTheme:
ListTileThemeData
(
shape:
shapeBorder
),
),
home:
Scaffold
(
key:
scaffoldKey
,
drawer:
const
Drawer
(
child:
ListTile
(),
),
body:
Container
(),
),
));
await
tester
.
pumpAndSettle
();
scaffoldKey
.
currentState
!.
openDrawer
();
// Start drawer animation.
await
tester
.
pump
();
final
ShapeBorder
?
inkWellBorder
=
tester
.
widget
<
InkWell
>(
find
.
descendant
(
of:
find
.
byType
(
ListTile
),
matching:
find
.
byType
(
InkWell
),
)).
customBorder
;
// Test shape.
expect
(
inkWellBorder
,
shapeBorder
);
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment