Skip to content
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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Domenic-MZS
Copy link
Contributor

πŸ”§πŸŽ¨ UI Fix: Adjust Scroll from clipping it's children form fields in the AlertDialog from showSourcesDialog (#1748)

This PR closes #1748

Overview

The AlertDialog's scrolling behavior for showSourcesDialog was causing children to clip, affecting user experience and readability, especially on devices with small screens or large fonts.

  • Issue: Children (form fields) were clipping within the AlertDialog.
  • Context: The structure for managing scrolling behavior was not efficient, leading to readability issues.
  • Related Solutions: No similar solution available.
  • Impact: Enhances readability and usability on various devices, ensuring a smoother user experience. (For smaller devices & devices with large fonts).

πŸ““ 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 Flutter AlertDialog, ensuring content within the dialog is properly displayed without clipping.

✍🏼 Changes Made

  • Removed child SingleChildScrollView.
  • Added parent dialog's scrollable property to true.

🦯 Testing

  • Update Tests (ToDo - Not Found nor needed for now...)
  • Compile/Build code
    • 🐞 Tested with Stable Flutter v3.19.3 and dart 3.3.1.
    • System: Linux archlinux 6.7.9-arch1-1 GNU/Linux

πŸ“‹ Notes & References

πŸ”¬ Reviewers

N/A (any mod is ok)


πŸ‘Ύ Feedback, changes, or suggestions are welcome! ✌🏼 πŸ–οΈ now a πŸ• emoji too...

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
Copy link
Contributor Author

@Domenic-MZS Domenic-MZS left a 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...

@oSumAtrIX oSumAtrIX linked an issue Mar 23, 2024 that may be closed by this pull request
4 tasks
Copy link
Contributor

βš’οΈ Build status

βœ… Succeeded build on 22272c3.

Details: 8404775438!

βš™οΈ Workflow run configuration

  • Flutter cache: true
  • App flavor: release

@@ -27,6 +27,7 @@ class SManageSources extends BaseViewModel {
return showDialog(
context: context,
builder: (context) => AlertDialog(
scrollable: true,
Copy link
Contributor Author

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 or Padding having a magic number that could not work on some specific MediaQuery's, virtual keyboards, or screen sizes.

scroll-sample.mp4

Copy link
Contributor Author

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.

@validcube
Copy link
Member

validcube commented Mar 23, 2024

βš’οΈ Build status

βœ… Succeeded build on 22272c3.

Details: 8404775438!

βš™οΈ Workflow run configuration

  • Flutter cache: true
  • App flavor: release

Note to team

Caution

DO NOT use the PR builder tool, this is affected by

@validcube validcube changed the title fix(ui): adjust scroll from clipping children form fields in AlertDialog from showSourcesDialog (#1748) fix(ui): Adjust scroll from clipping children form fields in AlertDialog from showSourcesDialog (#1748) Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Slight clipping in Alternative sources setting
2 participants