bond_form library

A library for working with forms and form validation.

Classes

Alpha
A validation rule that checks if a string contains only alphabetic characters.
AlphaDash
A validation rule that checks if a string contains only alphabetic characters, digits, underscores, and hyphens.
AlphaNum
A validation rule that checks if a string contains only alphanumeric characters.
AsyncDropDownFieldState<T>
Represents the state of an asynchronous dropdown (select) form field.
Between
A validation rule that checks if the length of a string falls within a specified range.
BondFormState<Success, Failure extends Error>
Represents the state of a form with its fields and submission status.
Boolean
A validation rule that checks if a string represents a boolean value.
CheckboxFieldState<T>
Represents the state of a checkbox form field.
CheckboxGroupFieldState<T>
Represents the state of a group of checkbox form fields.
Date
A validation rule that checks if a string represents a valid date.
DateAfter
A validation rule that checks if a date is after a specified date.
DateBefore
A validation rule that checks if a date is before a specified date.
DateFieldState
Represents the state of a date input form field.
Different<T>
A validation rule that checks if the value of the current field is different from another field's value.
Digits
A validation rule that checks if a string contains a specific number of digits.
DigitsBetween
A validation rule that checks if a string contains a number of digits within a specified range.
Represents the state of a dropdown (select) form field.
Represents the state of an individual item within a dropdown (select) field.
Email
A validation rule that checks if a string represents a valid email address.
FileFieldState
Represents the state of a file field in a form.
FileSizeRule
A Validation rule to check if the file size is within a specified limit.
FileTypeRule
A Validation rule to check if the file is of a specified type.
FormFieldState<T>
Represents the state of a form field.
HiddenFieldState<T>
Represents the state of a hidden field.
InList<T>
A validation rule that checks if a value is in a list of valid values.
Integer
A validation rule that checks if a string represents a valid integer.
IsFalse
A validation rule that checks if a boolean value is false.
IsTrue
A validation rule that checks if a boolean value is true.
MaxLength
A validation rule that checks if a string does not exceed a maximum length.
MaxSelected<T extends Iterable<G>, G>
A validation rule that checks if the number of selected items in an iterable does not exceed a maximum limit.
MaxValue
A validation rule that checks if a numeric value does not exceed a maximum limit.
MinLength
A validation rule that checks if a string meets a minimum length requirement.
MinSelected<T extends Iterable<G>, G>
A validation rule that checks if the number of selected items in an iterable meets a minimum requirement.
MinValue
A validation rule that checks if a numeric value meets a minimum requirement.
NotInList<T>
A validation rule that checks if a value is not in a list of invalid values.
Numeric
A validation rule that checks if a string represents a valid numeric value.
PhoneNumber
A validation rule that checks if a phone number is valid.
RadioButtonFieldState<T>
Represents the state of a radio button form field.
RadioGroupFieldState<T>
Represents the state of a group of radio buttons form fields.
RangeSelected<T>
A validation rule that checks if the number of selected items in an iterable falls within a specified range.
Regex
A validation rule that checks if a string matches a specified regular expression.
Required<T>
A validation rule that checks if a value is required (not empty or null).
RequiredIf<T>
A validation rule that checks if a value is required conditionally based on either a condition or the equality of another field's value.
Rules
A utility class that provides convenient methods to create instances of various validation rules.
Same<T>
A validation rule that checks if a value is the same as the value of another field.
Size
A validation rule that checks if a string has a specified size (length).
TextFieldState
Represents the state of a text input form field.
Url
A validation rule that checks if a string represents a valid URL.
ValidationRule<T>
Represents a validation rule that can be applied to a form field.

Enums

BondFormStateStatus
Represents the different states a BondFormState can be in.

Mixins

FormController<Success, Failure extends Error>
A mixin to manage the state and logic of a form.
HasValidationErrors
A mixin that provides a way to access validation errors. used in FormController to handle validation errors.

Extensions

FieldBondFormState on BondFormState<dynamic, Error>
Extension methods for BondFormState providing convenience operations.
ValueBondFormState on BondFormState<dynamic, Error>
Extension methods for BondFormState providing convenience operations.
XFormController on FormController<dynamic, Error>
Extension methods for FormController providing more type-safe updates.

Functions

different<T>(String otherField, {String? message}) Different<T>
Factory function for creating a Different validation rule.