fix overflow error in CupertinoListTile#113010
fix overflow error in CupertinoListTile#113010auto-submit[bot] merged 3 commits intoflutter:masterfrom
CupertinoListTile#113010Conversation
See flutter#78732 (comment) for more details.
MitchellGoodwin
left a comment
There was a problem hiding this comment.
Hi, thank you for putting this together. Because of the maxLines property in the text styles, like the one on line 285 of the list tile file, this would cause this change to not throw an error if there's an overflow, but it would keep the text to one line and not wrap. I think the Spacer also fulfills a role of making multiple tiles that have different content (i.e. additionalContent, trailing, and leading) look uniform, and I'm concerned taking it out would make the typical case of the title not needing to wrap look worse. Would you be able to play around with that? It would be helpful if you posted before and after screenshots as well, to make it easy to review.
|
Hi @MitchellGoodwin, I attached before and after screenshots in the original PR comment but I'm not quite sure what you mean with this comment relative to removing the
Anyways as you can see from the screenshots this PR does not change the behavior or layout of the widget in any way. Regarding the text wrapping I'm not sure if that should be the default behavior as in iOS, from what I've seen, the current behavior of setting I think the best solution to this would be to set the Example of overriding the default title: Builder(
builder: (context) {
return DefaultTextStyle(
style: DefaultTextStyle.of(context).style,
maxLines: 2,
child: Text('Title'),
);
},
), |
|
Ok, I was seeing some weird behavior with a lot of text added when I removed the spacer and removed the maxLines value. I thought the intention was to allow for text wrapping by default because of the issue, but I like the idea of leaving it set to a max line of one, and letting the developer override themselves. Could you add the |
… of `CupertinoListTile`
|
@MitchellGoodwin Done! And yeah looking back at the issue I see I originally expected it to wrap so sorry for the confusion. |
justinmc
left a comment
There was a problem hiding this comment.
LGTM 👍 Thanks for the fix!
See #78732 (comment) for more details.
This PR fixes an overflow error in the
CupertinoListTilewidget.Closes #108910.
Pre-launch Checklist
///).Before
After