Skip to content

TextField ​

A TextFormField wrapper with three border styles, validation, input formatting, and a built-in error state — the parameters mirror Flutter's own InputDecoration where it makes sense.

View source on GitHub ↗

CLI ​

Install this component into your project:

textfield
$flutter_beautify add textfield

Variants ​

FBTextField.outline() · FBTextField.filled() · FBTextField.underline() — the plain constructor forwards to .outline().

Key parameters ​

ParameterTypeDefault
label / hintString?—
controllerTextEditingController?—
keyboardTypeTextInputType.text
obscureTextboolfalse
validatorString? Function(String?)?—
prefixIcon / suffixIconWidget?—
errorText / isErrorString? / bool?—
inputFormattersList<TextInputFormatter>?—

Usage ​

dart
import 'package:your_app/widgets/textfield.dart';

FBTextField.outline(
  label: 'Email',
  keyboardType: TextInputType.emailAddress,
  validator: (v) => v != null && v.contains('@') ? null : 'Invalid email',
);

Released under the MIT License.