TextInput constructor
const
TextInput({
- Key? key,
- String? labelText,
- String? initialValue,
- TextInputType? keyboardType,
- int? maxCharsInLine,
- int maxLines = 1,
- int? maxLength,
- bool hExpandable = false,
- bool vExpandable = false,
- List<
DropdownListItem> ? options, - bool isOptionEditable = true,
- bool isRequired = false,
- bool readOnly = false,
- bool enabled = true,
- bool fixedHeight = true,
- InputIcon? leadingIcon,
- InputIcon? trailingIcon,
- TextStyle? textStyle,
- Color? focusedBorderColor,
- FocusNode? focusNode,
- TextEditingController? controller,
- List<
TextInputFormatter> ? inputFormatters, - Validator? validator,
- ValidatedValueChanged<
String?> ? onChanged, - ValueChanged<
String> ? onEnter, - EdgeInsets padding = const EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 0.0),
Implementation
const TextInput({
super.key,
this.labelText,
this.initialValue,
this.keyboardType,
this.maxCharsInLine,
this.maxLines = 1,
this.maxLength,
this.hExpandable = false,
this.vExpandable = false,
this.options,
this.isOptionEditable = true,
this.isRequired = false,
this.readOnly = false,
this.enabled = true,
this.fixedHeight = true,
this.leadingIcon,
this.trailingIcon,
this.textStyle,
this.focusedBorderColor,
this.focusNode,
this.controller,
this.inputFormatters,
this.validator,
this.onChanged,
this.onEnter,
this.padding = const EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 0.0),
}) : assert(
!hExpandable || (maxCharsInLine != null && maxCharsInLine > 1),
'When hExpandable is true, maxCharsInLine must be greater than 1',
),
assert(
options == null || (!hExpandable && !vExpandable),
'Dropdown options are not supported when input is expandable',
);