SmartTextFormField constructor

const SmartTextFormField({
  1. Key? key,
  2. required FormType formType,
  3. TextEditingController? controller,
  4. ValueChanged<String>? onChanged,
  5. String? fieldName,
  6. Color? fieldNameColor,
  7. double fieldFontSize = StandardFieldStyle.fieldFontSize,
  8. FontWeight fieldFontWeight = StandardFieldStyle.fieldFontWeight,
  9. String? hintText,
  10. Color? hintTextColor,
  11. double hintTextFontSize = StandardFieldStyle.hintTextFontSize,
  12. FontWeight hintTextFontWeight = StandardFieldStyle.hintTextFontWeight,
  13. String? emptyFieldErrorMessage,
  14. String? invalidFormErrorMessage,
  15. String? validator(
    1. String?
    )?,
  16. TextEditingController? matchController,
  17. int? minLength,
  18. TextCapitalization? textCapitalization,
  19. bool enabled = true,
  20. bool readOnly = false,
  21. AutovalidateMode? autovalidateMode,
  22. TextInputAction? textInputAction,
  23. ValueChanged<String>? onFieldSubmitted,
  24. Color? iconColor,
  25. double iconSize = StandardFieldStyle.iconSize,
  26. IconData? prefixIcon,
  27. IconData? suffixIconData,
  28. bool? outlinedIcon,
  29. BorderRadius? borderRadius,
  30. BorderSide? enabledBorderSide,
  31. BorderSide? focusedBorderSide,
  32. BorderSide? errorBorderSide,
  33. BorderSide? focusedErrorBorderSide,
  34. BoxBorder? borderStyle,
  35. TextStyle? errorMessageStyle,
  36. EdgeInsets insidePadding = StandardFieldStyle.insidePadding,
  37. EdgeInsets? outsidePadding,
  38. Color? fillColor,
  39. Color? primaryColor,
})

Creates a SmartTextFormField.

formType is required. When formType is FormType.confirmPassword, matchController must reference the primary password field.

Implementation

const SmartTextFormField({
  super.key,
  required this.formType,
  this.controller,
  this.onChanged,
  this.fieldName,
  this.fieldNameColor,
  this.fieldFontSize = StandardFieldStyle.fieldFontSize,
  this.fieldFontWeight = StandardFieldStyle.fieldFontWeight,
  this.hintText,
  this.hintTextColor,
  this.hintTextFontSize = StandardFieldStyle.hintTextFontSize,
  this.hintTextFontWeight = StandardFieldStyle.hintTextFontWeight,
  this.emptyFieldErrorMessage,
  this.invalidFormErrorMessage,
  this.validator,
  this.matchController,
  this.minLength,
  this.textCapitalization,
  this.enabled = true,
  this.readOnly = false,
  this.autovalidateMode,
  this.textInputAction,
  this.onFieldSubmitted,
  this.iconColor,
  this.iconSize = StandardFieldStyle.iconSize,
  this.prefixIcon,
  this.suffixIconData,
  this.outlinedIcon,
  this.borderRadius,
  this.enabledBorderSide,
  this.focusedBorderSide,
  this.errorBorderSide,
  this.focusedErrorBorderSide,
  this.borderStyle,
  this.errorMessageStyle,
  this.insidePadding = StandardFieldStyle.insidePadding,
  this.outsidePadding,
  this.fillColor,
  this.primaryColor,
}) : assert(
        formType != FormType.confirmPassword || matchController != null,
        'matchController is required when formType is confirmPassword',
      );