Implement AlertDialog title/content overflow scroll#43226
Merged
shihaohong merged 6 commits intoflutter:masterfrom Oct 28, 2019
shihaohong:alert-dialog-scroll
Merged
Implement AlertDialog title/content overflow scroll#43226shihaohong merged 6 commits intoflutter:masterfrom shihaohong:alert-dialog-scroll
shihaohong merged 6 commits intoflutter:masterfrom
shihaohong:alert-dialog-scroll
Conversation
HansMuller
approved these changes
Oct 22, 2019
Contributor
HansMuller
left a comment
There was a problem hiding this comment.
LGTM
Nice new feature!
| style: contentTextStyle ?? dialogTheme.contentTextStyle ?? theme.textTheme.subhead, | ||
| child: content, | ||
| child: SingleChildScrollView( | ||
| child: Column( |
Contributor
There was a problem hiding this comment.
I was surprised that MainAxisSize.min isn't needed here. It looks like it's not needed because none of the children are Expanded.
Contributor
Author
There was a problem hiding this comment.
It turns out that you were right -- not setting the mainAxisSize and crossAxisAlignment settings for the Column was breaking a DialogTheme golden test. I just implemented the fix.
shihaohong
pushed a commit
that referenced
this pull request
Nov 1, 2019
Merged
9 tasks
Inconnu08
pushed a commit
to Inconnu08/flutter
that referenced
this pull request
Nov 26, 2019
* Wrap alert dialog title and content in single child scroll view * Scrollable alert dialog title and content tests * Remove unnecessary comment * Fix mainAxisSize and crossAxisAlignment issue
Inconnu08
pushed a commit
to Inconnu08/flutter
that referenced
this pull request
Nov 26, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When the title and content are too tall in an AlertDialog, the title can end up overflowing while the content will be clipped. An example of this occurring is when the text scale factor is increased, causing parts of the alert dialog to be obscured.
This PR introduces a scroll view such that the title and content of an AlertDialog is scrollable so that its entire content can be viewed if need be.
Normal size behavior:
Original implementation causing overflow:
Overflow Fix:
Related Issues
Fixes part of #42696
Tests
I added the following tests:
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?