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
fix(ui): Adjust scroll from clipping children form fields in AlertDialog
from showSourcesDialog
(#1748)
#1782
base: dev
Are you sure you want to change the base?
Conversation
This commit resolves the issue of children clipping in `AlertDialog` for the `showSourcesDialog` by adjusting the structure to manage scrolling behavior more efficiently. By doing this, the user experience and readability is greatly improved on small devices and/or devices with large fonts. - Remove child SingleChildScrollView - Add parent (dialog) scrollable property to true
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.
At first glance it LGTM (Looks Good To Me), nothing screwed up so far...
βοΈ Build statusβ Succeeded build on 22272c3. Details: 8404775438! βοΈ Workflow run configuration
|
@@ -27,6 +27,7 @@ class SManageSources extends BaseViewModel { | |||
return showDialog( | |||
context: context, | |||
builder: (context) => AlertDialog( | |||
scrollable: true, |
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.
I noticed that the previous AlertDialog title was fixed in-place and the modified one is scrollable along the content with this line, as the title
and content
are wrapped with the scrollable
.
It's not that big of an issue, it looks natural (even only noticed after attaching the docs & refs) but it's the cleanest way to fully address this issue on all devices.
π¨ Break the glass in case of concern:
If this is unwanted, the 'hacky' alternatives would be to add extra padding or size with a
SizedBox
orPadding
having a magic number that could not work on some specificMediaQuery's
, virtual keyboards, or screen sizes.
scroll-sample.mp4
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.
This will be a plus because, after #1791, the title can now expand lines (grow in the Y axis [vertical] ) when it's too large to fit instead of clipping. This would make the [AlertDialog]
content smaller and smaller (improbable but still possible), which at some point would be very hard to scroll and interact.
However, if the title and content are scrollable, this wouldn't be the case, as the user could easily scroll and focus on the content after a multi-line title.
Note to teamCaution DO NOT use the PR builder tool, this is affected by
|
AlertDialog
from showSourcesDialog
(#1748)AlertDialog
from showSourcesDialog
(#1748)
π§π¨ UI Fix: Adjust Scroll from clipping it's children form fields in the
AlertDialog
fromshowSourcesDialog
(#1748)This PR closes #1748
Overview
The
AlertDialog
's scrolling behavior forshowSourcesDialog
was causing children to clip, affecting user experience and readability, especially on devices with small screens or large fonts.AlertDialog
.π Description
This PR addresses the issue of children clipping within the
AlertDialog
by adjusting the structure to handle scrolling more efficiently. It removes unnecessary scroll components and enables the builtin scroll handle from the FlutterAlertDialog
, ensuring content within the dialog is properly displayed without clipping.βπΌ Changes Made
SingleChildScrollView
.π¦― Testing
Update Tests (ToDo - Not Found nor needed for now...)Stable Flutter v3.19.3
anddart 3.3.1
.π Notes & References
π¬ Reviewers
N/A (any mod is ok)
πΎ Feedback, changes, or suggestions are welcome! βπΌ ποΈ now a π emoji too...