I saw some solutions and implemented them. Look Ok on Emulator but doesn't work on Real Device (See screens). So when I click on a textField, the keyboard moves up as per in-focus Textfield and I am able to scroll, however does not happen in real device. Thanks in advance for your time.
BottomSheet launched at FloatinActionButton
showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
context: context,
builder: (context) => SingleChildScrollView(
child: Container(
child: PostAd(),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
)),
),
);
The method PostAD shows several pages in Container (depending on Index chosen by user)
return Center(
child: Container(
height: MediaQuery.of(context).size.height / 1.5,
child: Center(
child: Container(
child: Column(
children: [
Center(child: radioButtonCreate()), // Radio Buttons to select Page Index
Expanded(child: kadFormList[formIndex]), //Pages i.e forms that has text field
],
),
),
),
question from:
https://stackoverflow.com/questions/65874792/textfield-stays-behind-keyboard-when-in-focus-at-bottomsheet-on-a-real-device-bu 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…