I have a Column of Expanded widgets like this:
return new Container(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
Well I think if we implement @Aman's solution it will make our app behaves ugly as when the keyboard appears, it will not adjust our viewport of the screen as per available height and it will make out other fields hide behind the keyboard. So I would suggest useSingleChildScrollView
instead.
Wrap your code with SingleChildScrollView
as given below,
return new Container(
child: SingleChildScrollView(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
new Expanded(
flex: 1,
child: convertFrom,
),
new Expanded(
flex: 1,
child: convertTo,
),
new Expanded(
flex: 1,
child: description,
),
],
),
),
);
Method 1: Remove android:windowSoftInputMode="adjustResize"
from AndroidManifest.xml file (Otherwise it will override flutter code) and add resizeToAvoidBottomPadding: false
in Scaffold like below:
Scaffold(
resizeToAvoidBottomPadding: false,
appBar: AppBar()
)
Method 2(Not Recommended): Just Add android:windowSoftInputMode="stateVisible"
in android AndroidManifest.xml in activity it will only work for Android an Not for IOS like.
<activity
...
android:windowSoftInputMode="stateVisible">
Note: Don't set it to android:windowSoftInputMode="adjustResize"
In your Scaffold
, set resizeToAvoidBottomInset
property to false
.
Property "resizeToAvoidBottomPadding" is deprecated now....
In your Scaffold
, set resizeToAvoidBottomPadding
property to false
.
Set resizeToAvoidBottomInset to false
instead of resizeToAvoidBottomPadding which is deprecated.
return Scaffold(
resizeToAvoidBottomInset : false,
body: YourWidgets(),
);
For me changing below item property from true to false
<item name="android:windowFullscreen">false</item>
in file
android/app/src/main/res/values/styles.xml
has made Flutter drag all page content upwards on input focus
Depending on the use case you could also consider using a listview. That would ensure that the contents scroll when there is not enough room. As an example, you can look at the textfield demo in the gallery app