EditText constructor
EditText({
- TextEditingController? controller,
- String? initialValue,
- String? label,
- FocusNode? focusNode,
- int minLength = 1,
- int maxLength = 256,
- bool allowEmpty = false,
- Color? cursorColor = Colors.deepOrange,
- Widget? prefixIcon,
- String? helperText,
- String? errorText,
- FuncString? onSubmitted,
- bool clear = true,
- Widget? suffixIcon,
- TextInputType? keyboardType = TextInputType.text,
- TextInputAction? textInputAction = TextInputAction.next,
- TextAlign textAlign = TextAlign.start,
- int? maxLines = 1,
- int? minLines,
- bool autofocus = false,
- InputDecoration? decoration = const InputDecoration(),
- void onChanged()?,
- void onTapOutside()?,
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!;
}
}