Repository navigation
SafeArea with keyboard #25758
Copy link
Copy link
Closed
Labels
frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packages
Description
Hello! (For iPhone x, xr and the like)
The bottom: true / false parameter for the safe area does not respond to changes when the keyboard is on, the bottom parameter is always false. In this connection, if the scaffold parameter has resizeToAvoidBottomPadding: false, and the keyboard appears, the entire widgets is shifted to down MediaQuery.of (context) .padding.bottom
return Scaffold(
resizeToAvoidBottomPadding: false,
body: SafeArea(
child: Center(
child: Container(
width: 200,
child: TextFormField(
decoration: InputDecoration(
hintText: 'text',
),
),
),
)),
);[✓] Flutter (Channel dev, v1.1.4, on Mac OS X 10.14.2 18C54, locale ru-RU)
• Flutter version 1.1.4 at /Users/alexfix/Flutter/flutter
• Framework revision 7a88fbc5fd (5 days ago), 2018-12-20 11:38:07 -0800
• Engine revision dbdb5e6f8c
• Dart version 2.2.0 (build 2.2.0-dev.1.1 f9ebf21297)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/alexfix/Library/Android/sdk
• Android NDK at /Users/alexfix/Library/Android/sdk/ndk-bundle
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• ios-deploy 2.0.0
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 31.3.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[✓] Connected device (1 available)
• iPhone XR • 0AB397AD-D503-4882-8849-B6F3229D2B23 • ios • iOS 12.1 (simulator)
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packages
Activity
HansMuller commentedon Jan 9, 2019
Scaffold was using its
resizeToAvoidBottomPadddingflag to conditionally inset the bottom of the body's layout by MediaQuery.viewInsets.bottom rather thanpadding.bottom.Additionally when
resizeToAvoidBottomPadddingwas true, the MediaQuery that wraps the Scaffold's body wasn't clearingpadding.left.This PR corrects the problems: #26259
This is the app I used to test this issue: https://gist.github.com/HansMuller/744554f045d62406f6b7f7240ab66fb2
When the keyboard appears the Scaffold's body is resized (bottom padding is ignored) and the text field remains centered above the keyboard. I assume that's what you expected.
zoechi commentedon Jan 10, 2019
HansMuller commentedon Jan 10, 2019
github-actions commentedon Aug 14, 2021
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 -vand a minimal reproduction of the issue.