text_field_builder 0.0.1 copy "text_field_builder: ^0.0.1" to clipboard
text_field_builder: ^0.0.1 copied to clipboard

A customizable Flutter package for building reusable and styled text fields, password inputs, and PIN code fields with validation and focus management.

text_field_builder #

A customizable and flexible Flutter package that helps you build text input fields, including password fields and PIN code inputs, using reusable models and styling components.

Features #

  • FieldModel to configure various properties of text fields
  • PasswordField widget with toggleable visibility and input validation
  • PinCodeField widget for entering secure codes (e.g., OTPs)
  • Easy management of input focus with InputFocusHandler
  • Country data list for use in forms (e.g., phone number inputs)
  • Simple configuration for border radius and input field decorations

Installation #

Add the following to your pubspec.yaml:

dependencies:
  text_field_builder: ^0.0.1

Then run:

flutter pub get

Getting Started #

Basic TextField using FieldModel #

final fieldModel = FieldModel(
  labelText: 'Username',
  hintText: 'Enter your username',
  errorMsg: 'Username is required',
);

PasswordField #

PasswordField(
  controller: _passwordController,
  labelText: 'Password',
  hintText: 'Enter your password',
  validator: (value) => value!.isEmpty ? 'Required' : null,
);

PinCodeField #

PinCodeField(
  onChanged: (value) {
    print('PIN: $value');
  },
);

Utility Classes #

InputFocusHandler #

Change focus between fields easily:

InputFocusHandler.changeFocusField(context, currentFocus, nextFocus);

MobileNumberInfo #

Helper for formatting international numbers:

final info = MobileNumberInfo(
  countryCode: '+1',
  countryISOCode: 'US',
  number: '1234567890',
);
print(info.completeNumber); // +11234567890

Customization #

You can customize input decorations, keyboard types, actions, and much more through FieldModel and widget parameters.

License #

MIT License. See LICENSE file for details.

0
likes
140
points
226
downloads

Publisher

unverified uploader

Weekly Downloads

A customizable Flutter package for building reusable and styled text fields, password inputs, and PIN code fields with validation and focus management.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

app_style, bloc, equatable, flutter, flutter_bloc, font_awesome_flutter, pin_code_fields, reusable_button

More

Packages that depend on text_field_builder