TUIInputField constructor
const
TUIInputField({
- Key? key,
- bool enabled = true,
- bool readOnly = false,
- String? hintText,
- String? labelText = 'Label',
- String? errorText,
- String? helperText,
- String? prefixText,
- String? suffixText,
- TextAlign textAlign = TextAlign.start,
- TextAlignVertical? textAlignVertical = TextAlignVertical.center,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextDirection? textDirection = TextDirection.ltr,
- int? maxLines = 1,
- int? minLines,
- bool expands = false,
- int? maxLength,
- Icon? prefixIcon,
- Color? prefixIconColor = TUIDefaultColors.inputText,
- Icon? suffixIcon,
- Color? suffixIconColor = TUIDefaultColors.inputText,
- bool obscureText = false,
- String obscuringCharacter = '*',
- TextEditingController? controller,
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- void onChanged()?,
- void onEditingComplete()?,
- void onSubmitted()?,
- void onTap()?,
Implementation
const TUIInputField({
super.key,
this.enabled = true,
this.readOnly = false,
this.hintText,
this.labelText = 'Label',
this.errorText,
this.helperText,
this.prefixText,
this.suffixText,
this.textAlign = TextAlign.start,
this.textAlignVertical = TextAlignVertical.center,
this.textCapitalization = TextCapitalization.none,
this.textDirection = TextDirection.ltr,
this.maxLines = 1,
this.minLines,
this.expands = false,
this.maxLength,
this.prefixIcon,
this.prefixIconColor = TUIDefaultColors.inputText,
this.suffixIcon,
this.suffixIconColor = TUIDefaultColors.inputText,
this.obscureText = false,
this.obscuringCharacter = '*',
this.controller,
this.keyboardType,
this.textInputAction,
this.onChanged,
this.onEditingComplete,
this.onSubmitted,
this.onTap,
}) : assert(maxLines == null || maxLines > 0),
assert(minLines == null || minLines > 0),
assert(
(maxLines == null) || (minLines == null) || (maxLines >= minLines),
"minLines can't be greater than maxLines",
),
assert(
!expands || (maxLines == null && minLines == null),
'minLines and maxLines must be null when expands is true.',
),
assert(!obscureText || maxLines == 1,
'Obscured fields cannot be multiline.'),
assert(maxLength == null ||
maxLength == TextField.noMaxLength ||
maxLength > 0);