TextFieldState constructor

TextFieldState(
  1. String? value, {
  2. required String label,
  3. String? error,
  4. List<ValidationRule<String?>> rules = const [],
  5. bool validateOnUpdate = true,
  6. bool touched = false,
})

Creates a new instance of TextFieldState.

  • value: The initial value of the text input field.
  • label: The label or name of the text input form field (required).
  • rules: The list of validation rules to apply to the text field (default is an empty list).
  • validateOnUpdate: Indicates whether validation should occur on updates (default is true).
  • touched: Indicates whether the field has been touched (interacted with) by the user (default is false).

Implementation

TextFieldState(
  String? value, {
  required String label,
  String? error,
  List<ValidationRule<String?>> rules = const [],
  bool validateOnUpdate = true,
  bool touched = false,
}) : super(
        value: value,
        error: error,
        label: label,
        rules: rules,
        validateOnUpdate: validateOnUpdate,
        touched: touched,
      );