CustomTextField constructor

const CustomTextField({
  1. Key? key,
  2. String? label,
  3. String? hintText,
  4. bool? isRequired = false,
  5. bool autofocus = false,
  6. String? validator(
    1. String?
    )?,
  7. InputType inputType = InputType.text,
  8. required TextEditingController controller,
})

Implementation

const CustomTextField({
  super.key,
  this.label,
  this.hintText,
  this.isRequired = false,
  this.autofocus = false,
  this.validator,
  this.inputType = InputType.text,
  required this.controller,
}) : assert(!(isRequired == true && label == null),
          'Please, you have to add label in order to be able to use isRequired');