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
e0a83e62
Unverified
Commit
e0a83e62
authored
Aug 31, 2022
by
Mohammed CHAHBOUN
Committed by
GitHub
Aug 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add splashColor property for ListTile widget (#100652)
parent
a490a6a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
list_tile.dart
packages/flutter/lib/src/material/list_tile.dart
+5
-0
list_tile_test.dart
packages/flutter/test/material/list_tile_test.dart
+24
-0
No files found.
packages/flutter/lib/src/material/list_tile.dart
View file @
e0a83e62
...
@@ -286,6 +286,7 @@ class ListTile extends StatelessWidget {
...
@@ -286,6 +286,7 @@ class ListTile extends StatelessWidget {
this
.
selected
=
false
,
this
.
selected
=
false
,
this
.
focusColor
,
this
.
focusColor
,
this
.
hoverColor
,
this
.
hoverColor
,
this
.
splashColor
,
this
.
focusNode
,
this
.
focusNode
,
this
.
autofocus
=
false
,
this
.
autofocus
=
false
,
this
.
tileColor
,
this
.
tileColor
,
...
@@ -495,6 +496,9 @@ class ListTile extends StatelessWidget {
...
@@ -495,6 +496,9 @@ class ListTile extends StatelessWidget {
/// The color for the tile's [Material] when a pointer is hovering over it.
/// The color for the tile's [Material] when a pointer is hovering over it.
final
Color
?
hoverColor
;
final
Color
?
hoverColor
;
/// The color of splash for the tile's [Material].
final
Color
?
splashColor
;
/// {@macro flutter.widgets.Focus.focusNode}
/// {@macro flutter.widgets.Focus.focusNode}
final
FocusNode
?
focusNode
;
final
FocusNode
?
focusNode
;
...
@@ -733,6 +737,7 @@ class ListTile extends StatelessWidget {
...
@@ -733,6 +737,7 @@ class ListTile extends StatelessWidget {
focusNode:
focusNode
,
focusNode:
focusNode
,
focusColor:
focusColor
,
focusColor:
focusColor
,
hoverColor:
hoverColor
,
hoverColor:
hoverColor
,
splashColor:
splashColor
,
autofocus:
autofocus
,
autofocus:
autofocus
,
enableFeedback:
enableFeedback
??
tileTheme
.
enableFeedback
??
true
,
enableFeedback:
enableFeedback
??
tileTheme
.
enableFeedback
??
true
,
child:
Semantics
(
child:
Semantics
(
...
...
packages/flutter/test/material/list_tile_test.dart
View file @
e0a83e62
...
@@ -1258,6 +1258,30 @@ void main() {
...
@@ -1258,6 +1258,30 @@ void main() {
);
);
});
});
testWidgets
(
'ListTile can be splashed and has correct splash color'
,
(
WidgetTester
tester
)
async
{
final
Widget
buildApp
=
MaterialApp
(
home:
Material
(
child:
Center
(
child:
SizedBox
(
width:
100
,
height:
100
,
child:
ListTile
(
onTap:
()
{},
splashColor:
const
Color
(
0xff88ff88
),
),
),
),
),
);
await
tester
.
pumpWidget
(
buildApp
);
await
tester
.
pumpAndSettle
();
final
TestGesture
gesture
=
await
tester
.
startGesture
(
tester
.
getRect
(
find
.
byType
(
ListTile
)).
center
);
await
tester
.
pump
(
const
Duration
(
milliseconds:
200
));
expect
(
find
.
byType
(
Material
),
paints
..
circle
(
x:
50
,
y:
50
,
color:
const
Color
(
0xff88ff88
)));
await
gesture
.
up
();
});
testWidgets
(
'ListTile can be triggered by keyboard shortcuts'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ListTile can be triggered by keyboard shortcuts'
,
(
WidgetTester
tester
)
async
{
tester
.
binding
.
focusManager
.
highlightStrategy
=
FocusHighlightStrategy
.
alwaysTraditional
;
tester
.
binding
.
focusManager
.
highlightStrategy
=
FocusHighlightStrategy
.
alwaysTraditional
;
const
Key
tileKey
=
Key
(
'ListTile'
);
const
Key
tileKey
=
Key
(
'ListTile'
);
...
...
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