Skip to content

Unwanted bouncing effect when opening keyboard on persistent sheet #66

Answered by fujidaiti
Tommy-Wang0602 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Tommy-Wang0602.

Are you using the MobileCalendarAddItemBottomSheet inside a Scaffold?
If so, that's the problem because the sheet and the SheetContentScaffold watch the MediaQueryData.viewInset.bottom to handle the appearing/disappearing of the keyboard, but the Scaffold consumes the viewInset resulting in the descendant widgets always getting viewInset.bottom == 0.

Here's the possible solutions for this case in my mind so far:

  • Set Scaffold.resizeToAvoidBottomInset to false, which prevents the Scaffold from consuming the viewInset.
  • Stack your sheet on top of the Scaffold rather than nesting them.
Stack(children: [ Scaffold(), YourSheet() ]);

Feel free to ask here if you have any que…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@bqubique
Comment options

@fujidaiti
Comment options

@bqubique
Comment options

@fujidaiti
Comment options

@bqubique
Comment options

Answer selected by fujidaiti
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #65 on March 16, 2024 05:08.