EditText constructor

EditText({
  1. TextEditingController? controller,
  2. String? initialValue,
  3. String? label,
  4. FocusNode? focusNode,
  5. int minLength = 1,
  6. int maxLength = 256,
  7. bool allowEmpty = false,
  8. Color? cursorColor = Colors.deepOrange,
  9. Widget? prefixIcon,
  10. String? helperText,
  11. String? errorText,
  12. FuncString? onSubmitted,
  13. bool clear = true,
  14. Widget? suffixIcon,
  15. TextInputType? keyboardType = TextInputType.text,
  16. TextInputAction? textInputAction = TextInputAction.next,
  17. TextAlign textAlign = TextAlign.start,
  18. int? maxLines = 1,
  19. int? minLines,
  20. bool autofocus = false,
  21. InputDecoration? decoration = const InputDecoration(),
  22. void onChanged(
    1. String
    )?,
  23. void onTapOutside(
    1. PointerDownEvent
    )?,
})

Implementation

EditText({
  TextEditingController? controller,
  this.initialValue,
  this.label,
  FocusNode? focusNode,
  this.minLength = 1,
  this.maxLength = 256,
  this.allowEmpty = false,
  this.cursorColor = Colors.deepOrange,
  this.prefixIcon,
  this.helperText,
  this.errorText,
  this.onSubmitted,
  this.clear = true,
  this.suffixIcon,
  this.keyboardType = TextInputType.text,
  this.textInputAction = TextInputAction.next,
  this.textAlign = TextAlign.start,
  this.maxLines = 1,
  this.minLines,
  this.autofocus = false,
  this.decoration = const InputDecoration(),
  this.onChanged,
  this.onTapOutside,
})  : controller = controller ?? TextEditingController(),
      focusNode = focusNode ?? FocusNode(),
      super() {
  if (this.initialValue != null && this.initialValue!.isNotEmpty) {
    this.controller.text = this.initialValue!;
  }
}