I have a long Form that contains multiple textfields.
When i try to fill the last ones the keyboard hide them !
I even used SingleChildScrollView and added this line to my scaffold
resizeToAvoidBottomInset: true,
But i still have same issue
code:
Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: Colors.white,
body: SafeArea(
child: SingleChildScrollView(
// reverse: false,
//physics: const CustomScrollPhysic(),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 20.0.w,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20.0.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: const Icon(Icons.arrow_back_ios_new_rounded),
),
const Spacer(),
Text(
'Profile',
style: TextStyle(
fontSize: 20.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
const Spacer(),
],
),
SizedBox(
height: 60.0.h,
),
EditProfileTextField(
field: _firstNameField,
controller: _firstNameController,
focusNode: firstNameFocusNode,
name: 'First name',
),
EditProfileTextField(
field: _lastNameField,
controller: _lastNameController,
focusNode: lastNameFocusNode,
name: 'Last Name',
),
EditProfileTextField(
field: _emailField,
controller: _emailController,
focusNode: emailFocusNode,
name: 'Email address',
),
EditProfileTextField(
field: _storeNameField,
controller: _storeNameController,
focusNode: storeNameFocusNode,
name: 'Store name',
),
EditProfileDropMenu(
name: 'Store country',
type: 'name',
value: selectedCountry,
data: countryData,
),
EditProfileTextField(
field: _companyNameField,
controller: _companyNameController,
focusNode: companyNameFocusNode,
name: 'Company name',
),
EditProfileTextField(
field: _addressField,
controller: _addressController,
focusNode: addressFocusNode,
name: 'Address',
),
EditProfileTextField(
field: _cityField,
controller: _cityController,
focusNode: cityFocusNode,
name: 'City',
),
2
Answers
Try adding that padding to the SingleChild widget.
Try this: Wrap you
Padding
inSizedBox()
and give it the hight of the screen