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
ce6188be
Unverified
Commit
ce6188be
authored
Apr 19, 2022
by
Hans Muller
Committed by
GitHub
Apr 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Update `ListTile` font (#101900)" (#102152)
This reverts commit
9f0bcfb8
.
parent
e5beafaf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
list_tile.dart
packages/flutter/lib/src/material/list_tile.dart
+9
-9
list_tile_test.dart
packages/flutter/test/material/list_tile_test.dart
+8
-8
No files found.
packages/flutter/lib/src/material/list_tile.dart
View file @
ce6188be
...
...
@@ -20,8 +20,8 @@ import 'theme_data.dart';
/// Defines the title font used for [ListTile] descendants of a [ListTileTheme].
///
/// List tiles that appear in a [Drawer] use the theme's [TextTheme.body
Medium
]
/// text style, which is a little smaller than the theme's [TextTheme.
titleMedium
]
/// List tiles that appear in a [Drawer] use the theme's [TextTheme.body
Text1
]
/// text style, which is a little smaller than the theme's [TextTheme.
subtitle1
]
/// text style, which is used by default.
enum
ListTileStyle
{
/// Use a title font that's appropriate for a [ListTile] in a list.
...
...
@@ -356,14 +356,14 @@ class ListTile extends StatelessWidget {
/// two lines. For example, you can use [Text.maxLines] to enforce the number
/// of lines.
///
/// The subtitle's default [TextStyle] depends on [TextTheme.body
Medium
] except
/// The subtitle's default [TextStyle] depends on [TextTheme.body
Text2
] except
/// [TextStyle.color]. The [TextStyle.color] depends on the value of [enabled]
/// and [selected].
///
/// When [enabled] is false, the text color is set to [ThemeData.disabledColor].
///
/// When [selected] is false, the text color is set to [ListTileTheme.textColor]
/// if it's not null and to [TextTheme.
bodySmall
]'s color if [ListTileTheme.textColor]
/// if it's not null and to [TextTheme.
caption
]'s color if [ListTileTheme.textColor]
/// is null.
final
Widget
?
subtitle
;
...
...
@@ -654,10 +654,10 @@ class ListTile extends StatelessWidget {
final
TextStyle
textStyle
;
switch
(
style
??
tileTheme
.
style
??
theme
.
listTileTheme
.
style
??
ListTileStyle
.
list
)
{
case
ListTileStyle
.
drawer
:
textStyle
=
theme
.
textTheme
.
body
Medium
!;
textStyle
=
theme
.
textTheme
.
body
Text1
!;
break
;
case
ListTileStyle
.
list
:
textStyle
=
theme
.
textTheme
.
titleMedium
!;
textStyle
=
theme
.
textTheme
.
subtitle1
!;
break
;
}
final
Color
?
color
=
_textColor
(
theme
,
tileTheme
,
textStyle
.
color
);
...
...
@@ -667,15 +667,15 @@ class ListTile extends StatelessWidget {
}
TextStyle
_subtitleTextStyle
(
ThemeData
theme
,
ListTileThemeData
tileTheme
)
{
final
TextStyle
textStyle
=
theme
.
textTheme
.
body
Medium
!;
final
Color
?
color
=
_textColor
(
theme
,
tileTheme
,
theme
.
textTheme
.
bodySmall
!.
color
);
final
TextStyle
textStyle
=
theme
.
textTheme
.
body
Text2
!;
final
Color
?
color
=
_textColor
(
theme
,
tileTheme
,
theme
.
textTheme
.
caption
!.
color
);
return
_isDenseLayout
(
theme
,
tileTheme
)
?
textStyle
.
copyWith
(
color:
color
,
fontSize:
12.0
)
:
textStyle
.
copyWith
(
color:
color
);
}
TextStyle
_trailingAndLeadingTextStyle
(
ThemeData
theme
,
ListTileThemeData
tileTheme
)
{
final
TextStyle
textStyle
=
theme
.
textTheme
.
body
Medium
!;
final
TextStyle
textStyle
=
theme
.
textTheme
.
body
Text2
!;
final
Color
?
color
=
_textColor
(
theme
,
tileTheme
,
textStyle
.
color
);
return
textStyle
.
copyWith
(
color:
color
);
}
...
...
packages/flutter/test/material/list_tile_test.dart
View file @
ce6188be
...
...
@@ -2208,25 +2208,25 @@ void main() {
// ListTile - ListTileStyle.list (default).
await
tester
.
pumpWidget
(
buildFrame
());
RenderParagraph
leading
=
_getTextRenderObject
(
tester
,
'leading'
);
expect
(
leading
.
text
.
style
!.
color
,
theme
.
textTheme
.
body
Medium
!.
color
);
expect
(
leading
.
text
.
style
!.
color
,
theme
.
textTheme
.
body
Text2
!.
color
);
RenderParagraph
title
=
_getTextRenderObject
(
tester
,
'title'
);
expect
(
title
.
text
.
style
!.
color
,
theme
.
textTheme
.
titleMedium
!.
color
);
expect
(
title
.
text
.
style
!.
color
,
theme
.
textTheme
.
subtitle1
!.
color
);
RenderParagraph
subtitle
=
_getTextRenderObject
(
tester
,
'subtitle'
);
expect
(
subtitle
.
text
.
style
!.
color
,
theme
.
textTheme
.
bodySmall
!.
color
);
expect
(
subtitle
.
text
.
style
!.
color
,
theme
.
textTheme
.
caption
!.
color
);
RenderParagraph
trailing
=
_getTextRenderObject
(
tester
,
'trailing'
);
expect
(
trailing
.
text
.
style
!.
color
,
theme
.
textTheme
.
body
Medium
!.
color
);
expect
(
trailing
.
text
.
style
!.
color
,
theme
.
textTheme
.
body
Text2
!.
color
);
// ListTile - ListTileStyle.drawer.
await
tester
.
pumpWidget
(
buildFrame
(
style:
ListTileStyle
.
drawer
));
await
tester
.
pumpAndSettle
();
leading
=
_getTextRenderObject
(
tester
,
'leading'
);
expect
(
leading
.
text
.
style
!.
color
,
theme
.
textTheme
.
body
Medium
!.
color
);
expect
(
leading
.
text
.
style
!.
color
,
theme
.
textTheme
.
body
Text2
!.
color
);
title
=
_getTextRenderObject
(
tester
,
'title'
);
expect
(
title
.
text
.
style
!.
color
,
theme
.
textTheme
.
body
Large
!.
color
);
expect
(
title
.
text
.
style
!.
color
,
theme
.
textTheme
.
body
Text1
!.
color
);
subtitle
=
_getTextRenderObject
(
tester
,
'subtitle'
);
expect
(
subtitle
.
text
.
style
!.
color
,
theme
.
textTheme
.
bodySmall
!.
color
);
expect
(
subtitle
.
text
.
style
!.
color
,
theme
.
textTheme
.
caption
!.
color
);
trailing
=
_getTextRenderObject
(
tester
,
'trailing'
);
expect
(
trailing
.
text
.
style
!.
color
,
theme
.
textTheme
.
body
Medium
!.
color
);
expect
(
trailing
.
text
.
style
!.
color
,
theme
.
textTheme
.
body
Text2
!.
color
);
});
testWidgets
(
'Default ListTile debugFillProperties'
,
(
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