SILENMUS
SILENMUS

Reputation: 947

Flutter TextFormField hint text vertical align

I'm using a custom hintText style, but I'm experiencing an alignment problem, as you can see below.

'Time' is not centered.

enter image description here

enter image description here This is just normal hinttext Style

here is my code :

Container(
  width: 60,
  margin: const EdgeInsets.only(left: 12),
  child: const BasicTextFormField(
    decoration: InputDecoration(
      counterText: '',
      hintText: 'Time',
      hintStyle: TextStyle(
        fontSize: 12,
        fontWeight: FontWeight.normal,
        color: Colors.grey,
      ),
      border: InputBorder.none, // Remove the underline
    ),
    textAlign: TextAlign.center,
  ),
),

I don't know why.

Upvotes: 0

Views: 27

Answers (1)

Neel Maniya
Neel Maniya

Reputation: 1

Container(
  width: 60,
  margin: const EdgeInsets.only(left: 12),
  child: const BasicTextFormField(
    decoration: InputDecoration(
      counterText: '',
      hintText: 'Time',
      hintStyle: TextStyle(
        fontSize: 12,
        fontWeight: FontWeight.normal,
        color: Colors.grey,
      ),
      border: InputBorder.none, // Remove the underline
    ),
    textAlign: TextAlign.center,
  ),
),

Upvotes: 0

Related Questions