Skip to content

Step 2 of 4: AboutDialog uses scrollable AlertDialog - #49913

Merged
fluttergithubbot merged 2 commits into
flutter:masterfrom
shihaohong:about-dialog-scrollable
Feb 1, 2020
Merged

fluttergithubbot merged 2 commits into
flutter:masterfrom
shihaohong:about-dialog-scrollable

Conversation

@shihaohong

@shihaohong shihaohong commented Jan 31, 2020 •

Copy link
Copy Markdown
Contributor

Migration Description

This is a temporary change that aims, in the future, to make the AlertDialog widget scrollable by default. The long-term goal is to make dialogs scrollable by default and remove the scrollable parameter altogether. This intermediate step is necessary because of our new breaking change policy requiring that our breaking changes be soft breaking changes. Making the new change opt-in allows developers the opportunity to experience the changes ahead of time so that they can fix any issues with the app resulting from the change or fix any broken tests that do not expect details in the new implementation.

Example migration steps

  1. Set all AlertDialog instances in app to have scrollable be true.
AlertDialog(
  scrollable: true, // add this line
  // ...
)
  1. Examine all screens with AlertDialogs to ensure that layout looks good, make sure existing unit tests are not breaking. If something is broken, fix it. An example of a test that might fail is if a unit test was using find.byType(SingleChildScrollView).first, the introduction of an additional SingleChildScrollView by default may not be expected by the test. If the issue cannot be fixed, it may not be an intended change, so file an issue to flutter/flutter on GitHub.
  2. A new PR will be introduced to set AlertDialog.scrollable to true by default. This will default everybody's AlertDialog to the latest design by default. If developers have properly migrated in step 2, this shouldn't cause any issues to your app. This would be the opportunity to remove the scrollable parameter from your application since it is true by default now and it will be removed in a subsequent PR.
AlertDialog(
  // scrollable: true, // remove this line, since it should be true by default at this point.
  // ...
)
  1. Finally, a final PR will remove the scrollable parameter altogether. If you removed the scrollable parameter from your `AlertDialog instances in step 3, this should not affect your application.

Change 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 sets AboutDialog's AlertDialog child's scrollable parameter to true by default and removes the SingleChildScrollView that wraps its contents. The scrollable parameter will eventually be removed as part of Step 3.

Normal size behavior:

Screen Shot 2019-10-21 at 4 56 01 PM

Original implementation causing overflow:

Screen Shot 2019-10-21 at 4 57 49 PM

Overflow Fix:

Screen Shot 2019-10-21 at 4 59 22 PM

scroll_alert_dialog

Related Issues

Fixes part of #42696

Tests

  • A test to ensure that AboutDialog's contents are still scrollable.

Glossary

Scrollable AlertDialog design document: https://flutter.dev/go/scrollable-alert-dialog
Breaking change notice on Flutter website: https://flutter.dev/docs/release/breaking-changes/scrollable_alert_dialog#context

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

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@fluttergithubbot fluttergithubbot added p: material_ui material_ui package in flutter/packages framework flutter/packages/flutter repository. See also f: labels. labels Jan 31, 2020
@fluttergithubbot

Copy link
Copy Markdown
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@HansMuller HansMuller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fluttergithubbot
fluttergithubbot merged commit e10df3c into flutter:master Feb 1, 2020
@shihaohong shihaohong changed the title Step 1.5 of 3: AboutDialog uses scrollable AlertDialog Step 2 of 4: AboutDialog uses scrollable AlertDialog Feb 11, 2020
@shihaohong
shihaohong deleted the about-dialog-scrollable branch April 3, 2020 19:06
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants