form_field_controller 0.0.3

SDKflutter
Platformandroidios

Form Field Controller

Form Field Controller

Simple and easy way to handle Form Fields and Validation.

Features

  • Controllers
  • Input Formatters
  • Input Validators
  • Predefined Form Widgets

Available Form Field Controller

How to use

Wrap all the form field widget inside Form widget.

PhoneFormFieldController phoneController = PhoneFormFieldController(const ValueKey("txtPhone"));
TextFormField(
  controller: phoneController.textEditingController,
  focusNode: phoneController.focusNode,
  validator: phoneController.validator,
  inputFormatters: phoneController.inputFormatter,
  maxLength: phoneController.maxLength,
  decoration: const InputDecoration(labelText: "Phone Number"),
),

Phone Form Field Controller

This controller is used to validate Phone number. It uses InputFormatter.phoneNoFormatter, InputValidator.phoneValidator

PhoneFormFieldController phoneController = PhoneFormFieldController(const ValueKey("txtPhone"), maxlength: 10);
ArgumentsDefault ValueDescription
keyValueKey
maxlength10
requiredtruetrue - mandatory field it can't be empty
requiredTextRequired!Message to show if the field is in error state

Email Form Field Controller

This controller is used to validate Email Field. It uses InputValidator.emailValidator

PhoneFormFieldController phoneController = PhoneFormFieldController(const ValueKey("txtPhone"), maxlength: 10);
ArgumentsDefault ValueDescription
keyValueKey
requiredtruetrue - mandatory field it can't be empty
requiredTextPlease enter a valid EmailMessage to show if the field is in error state

Feedback

You like the package ? Give me a thumbsup :thumbsup: