How do I get my widget to move up when the keyboard appears:
Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
child: Form(
key: formKey,
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
const SizedBox(height: Sizes.twenty),
Text(
appInfo.appName,
style: Theme.of(context)
.textTheme
.headlineMedium!
.copyWith(
color: Theme.of(context).colorScheme.primary,
fontWeight: FontWeight.w800,
),
),
const SizedBox(height: Sizes.forty),
SizedBox(
width: double.infinity,
child: Text(
tr(context)
.enterVerificationCodeTitle
.toUpperCase(),
style: const TextStyle(
fontSize: Sizes.twenty,
fontWeight: FontWeight.w700),
textAlign: TextAlign.start,
),
),
const SizedBox(height: 10),
SizedBox(
width: double.infinity,
child: Text(
tr(context)
.enterVerificationCodeBody(widget.phoneNumber),
style: const TextStyle(fontSize: Sizes.sixteen),
textAlign: TextAlign.start,
),
),
Container(
padding:
const EdgeInsets.symmetric(vertical: Sizes.ten),
child: Pinput(
defaultPinTheme: defaultPinTheme,
focusedPinTheme: focusedPinTheme,
length: 6,
onTap: () {
if (widget.error != null) {
controller.text = "";
}
},
onSubmitted: widget.verifyCode,
focusNode: focusNode,
controller: controller,
cursor: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
margin: const EdgeInsets.only(bottom: 9),
width: 22,
height: 1,
color: Theme.of(context).colorScheme.primary,
),
],
),
androidSmsAutofillMethod:
AndroidSmsAutofillMethod.none,
pinAnimationType: PinAnimationType.none,
pinputAutovalidateMode:
PinputAutovalidateMode.disabled,
validator: (pin) {
if (widget.error == null &&
pin != null &&
pin.length == 6) {
widget.verifyCode(pin);
}
return null;
},
),
),
const SizedBox(height: Sizes.twentyHeight),
SizedBox(
width: double.infinity,
child: CustomElevatedButton(
title: tr(context).validate.toUpperCase(),
backgroundColor: null,
foregroundColor: null,
onPressed: () {
focusNode.unfocus();
formKey.currentState!.validate();
},
),
),
const SizedBox(height: Sizes.twentyHeight),
TextButton(
onPressed: widget.delayBeforeNewCode > 0
? null
: widget.resendCode,
child: Text(
widget.delayBeforeNewCode > 0
? tr(context).delayHint(
widget.delayBeforeNewCode.toString())
: tr(context).resendCode,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.w600),
),
),
if (widget.error != null)
ErrorText(
message: widget.error?.getErrorText(context, null),
),
],
),
),
),
)
I have played with padding and mediaQuery without success.