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
e93297b9
Unverified
Commit
e93297b9
authored
Oct 17, 2022
by
Alex Sandri
Committed by
GitHub
Oct 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix overflow error in `CupertinoListTile` (#113010)
parent
300181b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
10 deletions
+42
-10
list_tile.dart
packages/flutter/lib/src/cupertino/list_tile.dart
+13
-10
list_tile_test.dart
packages/flutter/test/cupertino/list_tile_test.dart
+29
-0
No files found.
packages/flutter/lib/src/cupertino/list_tile.dart
View file @
e93297b9
...
...
@@ -283,6 +283,7 @@ class _CupertinoListTileState extends State<CupertinoListTile> {
final
Widget
title
=
DefaultTextStyle
(
style:
titleTextStyle
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
child:
widget
.
title
,
);
...
...
@@ -303,6 +304,7 @@ class _CupertinoListTileState extends State<CupertinoListTile> {
subtitle
=
DefaultTextStyle
(
style:
subtitleTextStyle
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
child:
widget
.
subtitle
!,
);
}
...
...
@@ -353,18 +355,19 @@ class _CupertinoListTileState extends State<CupertinoListTile> {
SizedBox
(
width:
widget
.
leadingToTitle
),
]
else
SizedBox
(
height:
widget
.
leadingSize
),
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
title
,
if
(
subtitle
!=
null
)
...<
Widget
>[
const
SizedBox
(
height:
_kNotchedTitleToSubtitle
),
subtitle
,
Expanded
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
title
,
if
(
subtitle
!=
null
)
...<
Widget
>[
const
SizedBox
(
height:
_kNotchedTitleToSubtitle
),
subtitle
,
],
],
]
,
)
,
),
const
Spacer
(),
if
(
additionalInfo
!=
null
)
...<
Widget
>[
additionalInfo
,
if
(
widget
.
trailing
!=
null
)
...
...
packages/flutter/test/cupertino/list_tile_test.dart
View file @
e93297b9
...
...
@@ -519,4 +519,33 @@ void main() {
await
tester
.
pumpAndSettle
(
const
Duration
(
seconds:
5
));
expect
(
tester
.
takeException
(),
null
);
});
testWidgets
(
'title does not overflow'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
CupertinoPageScaffold
(
child:
CupertinoListTile
(
title:
Text
(
'CupertinoListTile'
*
10
),
),
),
),
);
expect
(
tester
.
takeException
(),
null
);
});
testWidgets
(
'subtitle does not overflow'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
CupertinoPageScaffold
(
child:
CupertinoListTile
(
title:
const
Text
(
''
),
subtitle:
Text
(
'CupertinoListTile'
*
10
),
),
),
),
);
expect
(
tester
.
takeException
(),
null
);
});
}
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