InputFormatter class

InputFormatter class is a class to provide various input formatters for text fields.

Constructors

InputFormatter()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

adharFormatter() List<TextInputFormatter>
adharFormatter formats input as an Aadhaar number (e.g., XXXX XXXX XXXX).
alphabetFormatter() List<TextInputFormatter>
alphabetFormatter allows only alphabetic input.
alphaNumericFormatter() List<TextInputFormatter>
alphaNumericFormatter allows alphanumeric input.
capitalizeFirstLetterFormatter() List<TextInputFormatter>
capitalizeFirstLetterFormatter capitalizes the first letter of each word.
creditCardNumberFormatter() List<TextInputFormatter>
creditCardNumberFormatter formats input as a credit card number (e.g., XXXX XXXX XXXX XXXX).
customLengthFormatter(int maxLength) List<TextInputFormatter>
customLengthFormatter limits input to a specified maximum length.
customPatternFormatter(String pattern, {String placeholder = 'X'}) List<TextInputFormatter>
customPatternFormatter formats input based on a custom pattern. Example pattern: "XXX-XXX-XXXX" where 'X' is a placeholder for user input.
customRegexFormatter(String pattern) List<TextInputFormatter>
customRegexFormatter allows input based on a custom regular expression.
dateFormatter(FormatterEnum formatEnum, {String dateSeparator = '-', String timeSeparator = ':'}) List<TextInputFormatter>
dateFormatter formats take format from the user like "MM/DD/YYYY" or "DD-MM-YYYY"
decimalFormatter({int? decimalRange}) List<TextInputFormatter>
decimalFormatter allows numeric input including a single decimal point. decimalRange specifies the maximum number of digits allowed after the decimal point.
drivingLicenseFormatter() List<TextInputFormatter>
drivingLicenseFormatter formats input as a driving license number (e.g., XX-00-00-000000-000000).
gstFormatter() List<TextInputFormatter>
gstFormatter formats input as a GST number (e.g., 22AAAAA0000A1Z5).
ifscFormatter() List<TextInputFormatter>
ifscFormatter formats input as an IFSC code (e.g., ABCD0123456).
indianPhoneNumberFormatter() List<TextInputFormatter>
indianPhoneNumberFormatter formats input as an Indian phone number (e.g., +91 XXXXX-XXXXX).
lowerCaseFormatter() List<TextInputFormatter>
lowerCaseFormatter converts all input to lowercase.
maskedFormatter(String mask, {String placeholder = '*'}) List<TextInputFormatter>
maskedFormatter applies a mask to the input. Example mask: "--***" where '' is a placeholder for user input.
noAlphabetsFormatter() List<TextInputFormatter>
noAlphabetsFormatter prevents alphabetic input.
noDoubleSpaceFormatter() List<TextInputFormatter>
noDoubleSpaceFormatter prevents multiple consecutive spaces.
noEmojiFormatter() List<TextInputFormatter>
noEmojiFormatter prevents emoji characters.
noLeadingSpaceFormatter() List<TextInputFormatter>
noLeadingSpaceFormatter prevents leading spaces.
noNumbersFormatter() List<TextInputFormatter>
noNumbersFormatter prevents numeric input.
noSpecialCharacterFormatter() List<TextInputFormatter>
noSpecialCharacterFormatter prevents special characters.
noWhitespaceFormatter() List<TextInputFormatter>
noWhitespaceFormatter prevents all whitespace characters.
numberFormatter() List<TextInputFormatter>
numberFormatter allows only numeric input.
panFormatter() List<TextInputFormatter>
panFormatter formats input as a PAN number (e.g., XXXXX9999X).
phoneNumberFormatter() List<TextInputFormatter>
phoneNumberFormatter formats input as a phone number (e.g., (XXX) XXX-XXXX).
upperCaseFormatter() List<TextInputFormatter>
upperCaseFormatter converts all input to uppercase.
vehicleNumberFormatter() List<TextInputFormatter>
vehicleNumberFormatter formats input as a vehicle number (e.g., XX00XX0000).
voterIdFormatter() List<TextInputFormatter>
voterIdFormatter formats input as a voter ID (e.g., ABCD1234567).
zipCodeFormatter() List<TextInputFormatter>
zipCodeFormatter formats input as a ZIP code (e.g., XXXXX or XXXXX-XXXX).