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
402caec2
Unverified
Commit
402caec2
authored
Feb 13, 2023
by
Taha Tesser
Committed by
GitHub
Feb 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix `ListTile`'s default `iconColor` token used & update examples (#120444)
parent
f4495f5d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
14 deletions
+17
-14
list_tile_template.dart
dev/tools/gen_defaults/lib/list_tile_template.dart
+1
-1
list_tile.0.dart
examples/api/lib/material/list_tile/list_tile.0.dart
+2
-1
list_tile.1.dart
examples/api/lib/material/list_tile/list_tile.1.dart
+3
-2
list_tile.2.dart
examples/api/lib/material/list_tile/list_tile.2.dart
+1
-1
list_tile.3.dart
examples/api/lib/material/list_tile/list_tile.3.dart
+1
-1
list_tile.selected.0.dart
...ples/api/lib/material/list_tile/list_tile.selected.0.dart
+3
-2
list_tile.dart
packages/flutter/lib/src/material/list_tile.dart
+2
-2
list_tile_test.dart
packages/flutter/test/material/list_tile_test.dart
+4
-4
No files found.
dev/tools/gen_defaults/lib/list_tile_template.dart
View file @
402caec2
...
@@ -42,7 +42,7 @@ class _${blockName}DefaultsM3 extends ListTileThemeData {
...
@@ -42,7 +42,7 @@ class _${blockName}DefaultsM3 extends ListTileThemeData {
Color? get selectedColor =>
${componentColor('md.comp.list.list-item.selected.trailing-icon')}
;
Color? get selectedColor =>
${componentColor('md.comp.list.list-item.selected.trailing-icon')}
;
@override
@override
Color? get iconColor =>
${componentColor('md.comp.list.list-item.
unselected.
trailing-icon')}
;
Color? get iconColor =>
${componentColor('md.comp.list.list-item.trailing-icon')}
;
}
}
'''
;
'''
;
}
}
examples/api/lib/material/list_tile/list_tile.0.dart
View file @
402caec2
...
@@ -17,7 +17,8 @@ class ListTileApp extends StatelessWidget {
...
@@ -17,7 +17,8 @@ class ListTileApp extends StatelessWidget {
theme:
ThemeData
(
theme:
ThemeData
(
listTileTheme:
const
ListTileThemeData
(
listTileTheme:
const
ListTileThemeData
(
textColor:
Colors
.
white
,
textColor:
Colors
.
white
,
)
),
useMaterial3:
true
,
),
),
home:
const
LisTileExample
(),
home:
const
LisTileExample
(),
);
);
...
...
examples/api/lib/material/list_tile/list_tile.1.dart
View file @
402caec2
...
@@ -13,8 +13,9 @@ class ListTileApp extends StatelessWidget {
...
@@ -13,8 +13,9 @@ class ListTileApp extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
const
MaterialApp
(
return
MaterialApp
(
home:
LisTileExample
(),
theme:
ThemeData
(
useMaterial3:
true
),
home:
const
LisTileExample
(),
);
);
}
}
}
}
...
...
examples/api/lib/material/list_tile/list_tile.2.dart
View file @
402caec2
...
@@ -14,7 +14,7 @@ class ListTileApp extends StatelessWidget {
...
@@ -14,7 +14,7 @@ class ListTileApp extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
return
MaterialApp
(
theme:
ThemeData
(
colorSchemeSeed:
const
Color
(
0xff6750a4
),
useMaterial3:
true
),
theme:
ThemeData
(
useMaterial3:
true
),
home:
const
ListTileExample
(),
home:
const
ListTileExample
(),
);
);
}
}
...
...
examples/api/lib/material/list_tile/list_tile.3.dart
View file @
402caec2
...
@@ -14,7 +14,7 @@ class ListTileApp extends StatelessWidget {
...
@@ -14,7 +14,7 @@ class ListTileApp extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
return
MaterialApp
(
theme:
ThemeData
(
colorSchemeSeed:
const
Color
(
0xff6750a4
),
useMaterial3:
true
),
theme:
ThemeData
(
useMaterial3:
true
),
home:
const
ListTileExample
(),
home:
const
ListTileExample
(),
);
);
}
}
...
...
examples/api/lib/material/list_tile/list_tile.selected.0.dart
View file @
402caec2
...
@@ -13,8 +13,9 @@ class ListTileApp extends StatelessWidget {
...
@@ -13,8 +13,9 @@ class ListTileApp extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
const
MaterialApp
(
return
MaterialApp
(
home:
LisTileExample
(),
theme:
ThemeData
(
useMaterial3:
true
),
home:
const
LisTileExample
(),
);
);
}
}
}
}
...
...
packages/flutter/lib/src/material/list_tile.dart
View file @
402caec2
...
@@ -474,7 +474,7 @@ class ListTile extends StatelessWidget {
...
@@ -474,7 +474,7 @@ class ListTile extends StatelessWidget {
/// Defines the default color for [leading] and [trailing] icons.
/// Defines the default color for [leading] and [trailing] icons.
///
///
/// If this property is null and [selected] is false then [ListTileThemeData.iconColor]
/// If this property is null and [selected] is false then [ListTileThemeData.iconColor]
/// is used. If that is also null and [ThemeData.useMaterial3] is true, [ColorScheme.onSurface]
/// is used. If that is also null and [ThemeData.useMaterial3] is true, [ColorScheme.onSurface
Variant
]
/// is used, otherwise if [ThemeData.brightness] is [Brightness.light], [Colors.black54] is used,
/// is used, otherwise if [ThemeData.brightness] is [Brightness.light], [Colors.black54] is used,
/// and if [ThemeData.brightness] is [Brightness.dark], the value is null.
/// and if [ThemeData.brightness] is [Brightness.dark], the value is null.
///
///
...
@@ -1593,7 +1593,7 @@ class _LisTileDefaultsM3 extends ListTileThemeData {
...
@@ -1593,7 +1593,7 @@ class _LisTileDefaultsM3 extends ListTileThemeData {
Color
?
get
selectedColor
=>
_colors
.
primary
;
Color
?
get
selectedColor
=>
_colors
.
primary
;
@override
@override
Color
?
get
iconColor
=>
_colors
.
onSurface
;
Color
?
get
iconColor
=>
_colors
.
onSurface
Variant
;
}
}
// END GENERATED TOKEN PROPERTIES - LisTile
// END GENERATED TOKEN PROPERTIES - LisTile
packages/flutter/test/material/list_tile_test.dart
View file @
402caec2
...
@@ -1882,10 +1882,10 @@ void main() {
...
@@ -1882,10 +1882,10 @@ void main() {
expect
(
iconColor
(
trailingKey
),
colorScheme
.
primary
);
expect
(
iconColor
(
trailingKey
),
colorScheme
.
primary
);
await
tester
.
pumpWidget
(
buildFrame
(
selected:
false
));
await
tester
.
pumpWidget
(
buildFrame
(
selected:
false
));
expect
(
iconColor
(
leadingKey
),
colorScheme
.
onSurface
);
expect
(
iconColor
(
leadingKey
),
colorScheme
.
onSurface
Variant
);
expect
(
iconColor
(
titleKey
),
colorScheme
.
onSurface
);
expect
(
iconColor
(
titleKey
),
colorScheme
.
onSurface
Variant
);
expect
(
iconColor
(
subtitleKey
),
colorScheme
.
onSurface
);
expect
(
iconColor
(
subtitleKey
),
colorScheme
.
onSurface
Variant
);
expect
(
iconColor
(
trailingKey
),
colorScheme
.
onSurface
);
expect
(
iconColor
(
trailingKey
),
colorScheme
.
onSurface
Variant
);
});
});
testWidgets
(
'ListTile font size'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ListTile font size'
,
(
WidgetTester
tester
)
async
{
...
...
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