InputText constructor

InputText({
  1. Key? key,
  2. String value = "",
  3. bool obscureText = false,
  4. String placeholder = "",
  5. bool emptyOnSubmit = false,
  6. dynamic onChanged(
    1. String,
    2. dynamic
    )?,
  7. dynamic onSubmitted(
    1. String,
    2. dynamic
    )?,
  8. int maxLines = 1,
})

Implementation

InputText({
  super.key,
  String value = "",
  this.obscureText = false,
  this.placeholder = "",
  this.emptyOnSubmit = false,
  this.onChanged,
  this.onSubmitted,
  this.maxLines = 1,
}) {
  text.value = value;
  showPassword.value = !obscureText;
  controller = TextEditingController(text: text.value);
  controller.addListener(() {
    text.value = controller.text;
    if (onChanged != null) {
      onChanged!(text.value, this);
    }
  });
}