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

Bottomsheet is overlapped by the keyboard ( Both persistent and modal ) #17861

Closed
iampawan opened this issue May 24, 2018 · 10 comments
Closed

Bottomsheet is overlapped by the keyboard ( Both persistent and modal ) #17861

iampawan opened this issue May 24, 2018 · 10 comments
Labels
a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.

Comments

@iampawan
Copy link

screenshot_20180524-135141


I want to implement something like this . I used modalbottomsheet with a texfield inside that but as soon as I click on it my bottomsheet with height around 100.0 is overlapped by the keyboard . I tried to fix this but couldn't . Please help thanks

@thelazyindian
Copy link

Well I found a workaround for this issue

@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. a: text input Entering text in a text field or keyboard related problems labels Jul 10, 2018
@iampawan
Copy link
Author

@thelazyindian Yes, I would love to hear that.

@thelazyindian
Copy link

thelazyindian commented Jul 14, 2018

Basically I used AnimatedPadding inside which Mediaquery viewInsets gets me the required padding after keyboard pops up to push the modalBottomSheet from bottom and thus preventing keyboard from overlapping my modalBottomSheet. Still there's some issue, The word suggestions bar displaying just above keyboard still overlaps bottom sheet lol. Still a better fix is needed.

return new AnimatedPadding(
            padding: MediaQuery.of(context).viewInsets,
            duration: const Duration(milliseconds: 100),
            curve: Curves.decelerate,
            child: new Container(
              alignment: Alignment.bottomCenter,
              child: Wrap(
                children: <Widget>[
                                  new Text("Blah Blah"), 
                               ],
                         ), 
                 ),
        );

@frederickcxa
Copy link

Any other solution for this?

@zoechi zoechi added this to the Goals milestone Aug 30, 2018
@eurotrip11
Copy link

Any news for this?

@rodydavis
Copy link
Contributor

rodydavis commented Nov 16, 2018

I took @thelazyindian approach and did exactly what @iampawan was trying to do:

https://github.com/AppleEducate/Tasks

on the page: lib>pages>home_page.dart
https://github.com/AppleEducate/Tasks/blob/master/lib/pages/home_page.dart

@zoechi
Copy link
Contributor

zoechi commented Nov 27, 2018

Looks like a dup of #18564 (this is older but the other has more activity)

@goderbauer
Copy link
Member

Dupe of #18564.

@socrates93
Copy link

Basically I used AnimatedPadding inside which Mediaquery viewInsets gets me the required padding after keyboard pops up to push the modalBottomSheet from bottom and thus preventing keyboard from overlapping my modalBottomSheet. Still there's some issue, The word suggestions bar displaying just above keyboard still overlaps bottom sheet lol. Still a better fix is needed.

return new AnimatedPadding(
            padding: MediaQuery.of(context).viewInsets,
            duration: const Duration(milliseconds: 100),
            curve: Curves.decelerate,
            child: new Container(
              alignment: Alignment.bottomCenter,
              child: Wrap(
                children: <Widget>[
                                  new Text("Blah Blah"), 
                               ],
                         ), 
                 ),
        );

This works correctly. Additionally, to the showModalBottomSheet you must add the isScrollControlled to true. With this, it works wonderfully.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

8 participants