title: How to emptying hint text when focus in TextFormField Flutter
body: <p>I want to make the hint text in TextFormField disappear when the field focused. But the hint text won't disappear until I insert a character in the field. I did the following. How can I make the hint text disappear when the field focused? Thanks!</p>
  
  <pre><code>Container buildTextField(bool isObscure, TextEditingController textEditingController, String hintText, bool onlyNumber) {
      return Container(
        width: double.infinity,
        height: 60,
        color: MyColors.primary,
        alignment: Alignment.center,
        child: Padding(
          padding: EdgeInsets.only(left: 15, right: 10),
          child: TextFormField(
            textAlign: TextAlign.center,
            keyboardType: onlyNumber ? TextInputType.number : TextInputType.text,
            decoration: InputDecoration(
              hintText: hintText,
              hintStyle: TextStyle(
                color: Colors.white,
                fontWeight: FontWeight.w600,
              ),
              border: InputBorder.none,
            ),
            style: TextStyle(
              color: Colors.white,
              decoration: TextDecoration.none,
              fontWeight: FontWeight.w600,
            ),
            obscureText: isObscure,
            controller: textEditingController,
          ),
        ),
      );
    }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/QUwor.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QUwor.jpg" alt="enter image description here"></a></p>