Home > Blockchain >  What are the important attributes/properties of TextFormField in Flutter?
What are the important attributes/properties of TextFormField in Flutter?

Time:08-13

What are the important attributes/properties of TextFormField in Flutter can someone tell me?

CodePudding user response:

You can study the constructor about TextFormField

Here is the example of TextFormField

TextFormField(
  decoration: InputDecoration(
    isDense: true,
    labelText: labelText,
    labelStyle: TextStyle(fontFamily: "ROCK", color: labelColor),
    floatingLabelBehavior: FloatingLabelBehavior.always,
  
    focusedBorder: OutlineInputBorder(
        borderSide: BorderSide(color: borderColor!),
        borderRadius: BorderRadius.circular(15)),
    enabledBorder: OutlineInputBorder(
        borderSide: BorderSide(color: borderColor!),
        borderRadius: BorderRadius.circular(15)),
  ),
);

CodePudding user response:

Also Check TextFormField Properties here

TextFormField(
  decoration: const InputDecoration(
    icon: Icon(Icons.person),
    hintText: 'Hint Text',
    labelText: 'Name *',
  ),
  onSaved: (String? value) {      },
  validator: (String? value) {
    return (value != null && value.contains('@')) ? 'Do not use the @ char.' : null;
  },
)
  • Related