Ga naar hoofdinhoud
Logo Appt Light

Input label on Flutter

Input fields should have labels so that users know what input data is expected. These labels should stay visible while users are entering data. A placeholder which disappears while entering data does not count as a label.

In Flutter, there is no attribute to link a label to an input field. You can use an InputDecoration to show a label for a TextField. You need to provide a Text widget for the label property.

TextField(
    decoration: InputDecoration(
        label: Text('Name')
    ),
);
Bijdragen

Feedback?

Laat 't ons weten!