-
Notifications
You must be signed in to change notification settings - Fork 28.7k
fix overflow error in CupertinoListTile
#113010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
See flutter#78732 (comment) for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Thanks for the fix!
See #78732 (comment) for more details.
This PR fixes an overflow error in the
CupertinoListTile
widget.Closes #108910.
Pre-launch Checklist
///
).Before
After