Search code examples
androidflutterdartflutter-layout

Keyboard is not showing on clicking on TextFormField in Flutter Android


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,
      ),
    ),
  ),
)

Solution

  • onTap(){
       FocusNode.requestFocus();
    }