Flutter_form_builder: How to set hint for FormBuilderTextField?

Created on 31 Aug 2020  路  1Comment  路  Source: danvick/flutter_form_builder

The hintText attribute in InputDecoration seems doesn't work!

  FormBuilderTextField(
      name: 'name',
      decoration: const InputDecoration(
        labelText: 'Name',
        border: InputBorder.none,
        hintText: 'hint text',
        filled: true,
      ),
      validator: FormBuilderValidators.compose([
        FormBuilderValidators.max(context, 8),
        FormBuilderValidators.max(context, 24),
      ]),
    );
question

Most helpful comment

Hi @bloodnwine,
Kindly note that hintText will only show when:
a. the labelText is either floating or empty
b. the field is empty.

If you need the hintText to always show, consider setting floatingLabelBehavior to FloatingLabelBehavior.always

>All comments

Hi @bloodnwine,
Kindly note that hintText will only show when:
a. the labelText is either floating or empty
b. the field is empty.

If you need the hintText to always show, consider setting floatingLabelBehavior to FloatingLabelBehavior.always

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WilliamCunhaCardoso picture WilliamCunhaCardoso  路  3Comments

ghost picture ghost  路  4Comments

vimalmistry picture vimalmistry  路  4Comments

gilthonweapps picture gilthonweapps  路  3Comments

rdcoder33 picture rdcoder33  路  6Comments