Skip to content

Conversation

@prateek-kalwar-95
Copy link
Contributor

@prateek-kalwar-95 prateek-kalwar-95 commented Dec 28, 2025

Description

Implemented dynamic height calculation for the Add Task bottom sheet to prevent overflow on small screens when the keyboard opens. The sheet now adapts intelligently to available space and allows smooth scrolling through all form fields.

  • Added dynamic BoxConstraints that calculate available screen space based on keyboard visibility
  • Bottom sheet now uses 80% of screen height when keyboard is closed
  • When keyboard opens, sheet adjusts to remaining space minus 50% of keyboard height
  • Added BouncingScrollPhysics for smoother scrolling experience

Fixes #534

Screenshots

before->

before

After ->

WhatsApp Image 2025-12-28 at 2 07 38 PM

When keyboard closed ->

keyboard closed

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

@prateek-kalwar-95
Copy link
Contributor Author

@SGI-CAPP-AT2 , could you please review this PR? The previous PR addressing this issue got mixed with #541, so I've created a separate one for clarity.

@SGI-CAPP-AT2
Copy link
Collaborator

@prateek-kalwar-95, add screenshot with keyboard closed

@prateek-kalwar-95
Copy link
Contributor Author

@SGI-CAPP-AT2 , Added it.

@SGI-CAPP-AT2
Copy link
Collaborator

@prateek-kalwar-95 , I think the the gap you're having when keyboard opened is too large it should be equal to height of status bar so that more task inputs can be shown.

@prateek-kalwar-95
Copy link
Contributor Author

@SGI-CAPP-AT2 , Yes, we can do that, but the save button is just below the status bar, which may make it difficult for users to tap.

@prateek-kalwar-95
Copy link
Contributor Author

So we can put it at least 50px below the status bar.

@SGI-CAPP-AT2
Copy link
Collaborator

rn it overlaps with status bar, instead keep offset from top equal to height of status bar so it wont overlap.

@SGI-CAPP-AT2
Copy link
Collaborator

So we can put it at least 50px below the status bar.
@prateek-kalwar-95, make immediate after status bar.

@prateek-kalwar-95
Copy link
Contributor Author

prateek-kalwar-95 commented Dec 29, 2025

@SGI-CAPP-AT2 , For me, the height of the status bar is coming as zero, and this is happening because AddTaskBottomSheet is built inside a Container.

@SGI-CAPP-AT2
Copy link
Collaborator

@prateek-kalwar-95
Tried this?

final height = MediaQuery.viewInsetsOf(context).top;

@prateek-kalwar-95
Copy link
Contributor Author

prateek-kalwar-95 commented Dec 29, 2025

@SGI-CAPP-AT2 ,tried but still coming zero.

@SGI-CAPP-AT2
Copy link
Collaborator

@SGI-CAPP-AT2 ,tried but still coming zero.

@prateek-kalwar-95,
Try This may be

final height = MediaQuery.paddingOf(context).top;

@prateek-kalwar-95
Copy link
Contributor Author

final height = MediaQuery.paddingOf(context).top;

@SGI-CAPP-AT2 , This is also returning zero.

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.

Bottom sheet shifts entirely up when keyboard opens, hiding content

2 participants