Flutter pop-up keyboard error resolution

Flutter pop-up keyboard error resolution


wrong reason

Error page:

wrong reason:

This kind of error occurs when the content of a page cannot be fully displayed. In fact, if there is no keyboard pop-up and the content length exceeds the displayable range of the screen, an error will also be reported.

Solution

This problem is also very easy to solve, 2 methods.

  1. Set the resizeToAvoidBottomPadding property of Scaffold to false, so that the page will not scroll with the keyboard popping up (this method is only for the case where the pop-up keyboard reports an error. If the page content length exceeds the screen display range, this method is invalid).
Scaffold(
        resizeToAvoidBottomPadding: false,
        ……

Using this method will prevent the exception reported by the pop-up, but the pop-up may still block the input box and affect user input.

  1. Add a scroll view, this method directly and completely solve this kind of problem, it is recommended to use:
SingleChildScrollView(
    child:new Column(
        ……
    ),
    ……
)

Just add a SingleChildScrollView control outside the view, it's very simple!


**PS: For more exciting content, please check --> "Flutter Development"
**PS: For more exciting content, please check --> "Flutter Development"
**PS: For more exciting content, please check --> "Flutter Development"

Guess you like

Origin blog.csdn.net/u011578734/article/details/111935370