I'm using TextFormField in flutter app. In my app everywhere It's working fine, But just in one screen it giving me an error. When I click on TextFormField then Keyboard opened and instantly hide automatically. Here is my code for TextFormField.
TextFormField(
controller: offerController,
maxLines: 1,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
style: GoogleFonts.arimo(
textStyle: const TextStyle(
color: Color(ColorConstants.TEXT_COLOR_GREY),
fontSize: 14.0,
fontWeight: FontWeight.w400,
),
),
decoration: InputDecoration(
border: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "Add the Offer Value",
hintStyle: GoogleFonts.arimo(
textStyle: const TextStyle(
color:
Color(ColorConstants.COLOR_BFBFBF),
fontSize: 14.0,
fontWeight: FontWeight.w400,
),
),
),
)
CodePudding user response:
Add this to your textFormField.
keyboardType: TextInputType.numberWithOptions(signed: true),
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
],
CodePudding user response:
onTap(){
FocusNode.requestFocus();
}
CodePudding user response:
In this case, if you use the ios emulator, you can see the this link Flutter - Keyboard not showing when TextFormField is selected