TextFormFieldWidget constructor

const TextFormFieldWidget({
  1. Key? key,
  2. required TextEditingController textController,
  3. String? label,
  4. String? hint,
  5. required bool? isSuffixRequired,
  6. required bool isPassword,
  7. int? maxLength,
  8. int? maxlines,
  9. bool? isPrefixIconrequired,
  10. Icon? prefixIcon,
  11. bool? enabled,
  12. required double width,
  13. void onChanged(
    1. String
    )?,
  14. void onEditingComplete()?,
  15. required double fontSize,
  16. Color? fillColor,
})

Creates a new instance of TextFormFieldWidget.

  • textController - A TextEditingController to display the text the user enters
  • label - A String to show as the label for the text field.
  • hint - A String to show as the hint for the text field.
  • onChanged - An optional callback function that might be needed in some textfields to display something in the same page
  • maxlines - an optional maxlines of type int
  • maxLength - an optional maxlength of type int
  • isPrefixIconrequired -an optional bool to check if a prefix icon is required for that field
  • prefixIcon - an optional prefix icon
  • isSuffixRequired - to check if the field is required or not to display a red (*)
  • enabled - optional enabled to check if the textfield will be enabled or not *onEditingComplete -optional callback function to be called when we want to do something when user finish editing the field fontSize for the responsive layout

Implementation

const TextFormFieldWidget({
  super.key,
  required TextEditingController textController,
  String? label,
  String? hint,
  required bool? isSuffixRequired,
  required bool isPassword,
  int? maxLength,
  int? maxlines,
  bool? isPrefixIconrequired,
  Icon? prefixIcon,
  bool? enabled,
  required this.width,
  this.onChanged,
  this.onEditingComplete,
  required this.fontSize,
  this.fillColor,
})  : _textController = textController,
      _label = label,
      _hint = hint,
      _isSuffixRequired = isSuffixRequired,
      _maxLength = maxLength,
      _maxlines = maxlines,
      _isPrefixIconRequired = isPrefixIconrequired,
      _prefixIcon = prefixIcon,
      _enabled = enabled,
      _isPassword = isPassword;