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
Show 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> {
...
@@ -283,6 +283,7 @@ class _CupertinoListTileState extends State<CupertinoListTile> {
final
Widget
title
=
DefaultTextStyle
(
final
Widget
title
=
DefaultTextStyle
(
style:
titleTextStyle
,
style:
titleTextStyle
,
maxLines:
1
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
child:
widget
.
title
,
child:
widget
.
title
,
);
);
...
@@ -303,6 +304,7 @@ class _CupertinoListTileState extends State<CupertinoListTile> {
...
@@ -303,6 +304,7 @@ class _CupertinoListTileState extends State<CupertinoListTile> {
subtitle
=
DefaultTextStyle
(
subtitle
=
DefaultTextStyle
(
style:
subtitleTextStyle
,
style:
subtitleTextStyle
,
maxLines:
1
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
child:
widget
.
subtitle
!,
child:
widget
.
subtitle
!,
);
);
}
}
...
@@ -353,7 +355,8 @@ class _CupertinoListTileState extends State<CupertinoListTile> {
...
@@ -353,7 +355,8 @@ class _CupertinoListTileState extends State<CupertinoListTile> {
SizedBox
(
width:
widget
.
leadingToTitle
),
SizedBox
(
width:
widget
.
leadingToTitle
),
]
else
]
else
SizedBox
(
height:
widget
.
leadingSize
),
SizedBox
(
height:
widget
.
leadingSize
),
Column
(
Expanded
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
children:
<
Widget
>[
...
@@ -364,7 +367,7 @@ class _CupertinoListTileState extends State<CupertinoListTile> {
...
@@ -364,7 +367,7 @@ class _CupertinoListTileState extends State<CupertinoListTile> {
],
],
],
],
),
),
const
Spacer
(
),
),
if
(
additionalInfo
!=
null
)
...<
Widget
>[
if
(
additionalInfo
!=
null
)
...<
Widget
>[
additionalInfo
,
additionalInfo
,
if
(
widget
.
trailing
!=
null
)
if
(
widget
.
trailing
!=
null
)
...
...
packages/flutter/test/cupertino/list_tile_test.dart
View file @
e93297b9
...
@@ -519,4 +519,33 @@ void main() {
...
@@ -519,4 +519,33 @@ void main() {
await
tester
.
pumpAndSettle
(
const
Duration
(
seconds:
5
));
await
tester
.
pumpAndSettle
(
const
Duration
(
seconds:
5
));
expect
(
tester
.
takeException
(),
null
);
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