textFieldDecoration method

InputDecoration textFieldDecoration({
  1. required String labelText,
  2. Color borderSideColor = Colors.black,
})

Creates a standard text field input decoration with label and border.

Provides a consistent InputDecoration configuration for text fields with an outlined border and label text.

Parameters:

  • labelText: The label displayed above/inside the text field.
  • borderSideColor: Color of the outline border (defaults to black).

Returns an InputDecoration with outlined border styling.

Example:

TextField(
  decoration: textFieldDecoration(
    labelText: 'Email Address',
    borderSideColor: Colors.blue,
  ),
);

Implementation

InputDecoration textFieldDecoration(
    {required String labelText, Color borderSideColor = Colors.black}) {
  return InputDecoration(
      labelText: labelText,
      border:
          OutlineInputBorder(borderSide: BorderSide(color: borderSideColor)));
}