widget_text_form_field

pub package

A customizable TextFormField widget in Flutter with built-in support for validation, date/year pickers, and currency formatting.

Features

  • Custom border, icons, and label/hint support.
  • Built-in support for:
    • Email validation
    • Date picker
    • Year picker
    • Currency formatting
  • Support for readonly, multiline, max length, etc.

Installation

Add this to your pubspec.yaml:

dependencies:
  widget_text_form_field: ^0.0.1+2

Then run:

flutter pub get

Usage

import 'package:widget_text_form_field/widget_text_form_field.dart';

CustomTextFormField(
  controller: TextEditingController(),
  labelText: "Enter amount",
  hintText: "0",
  type: "number",
  currency: true,
)

Parameters

Property Type Description
controller TextEditingController Required: Controls the input
labelText String Required: Label above input
hintText String Required: Placeholder
type String? Optional: 'email', 'number', 'date', 'year'
readOnly bool? Optional: Set read-only
currency bool? Optional: Enable currency formatting
prefixIcon Widget? Optional: Leading icon
suffixIcon Widget? Optional: Trailing icon
onChanged Function? Optional: Value change callback

License

See LICENSE file.

Example

See the example directory for a complete sample app.