TTextField<T extends String?> constructor
const
TTextField<T extends String?> ({
- Key? key,
- String? label,
- String? tag,
- String? helperText,
- String? info,
- String? placeholder,
- bool isRequired = false,
- bool disabled = false,
- bool autoFocus = false,
- bool readOnly = false,
- bool clearable = false,
- bool obscureText = false,
- TTextFieldTheme? theme,
- Widget? preWidget,
- Widget? postWidget,
- TInputSize? size,
- TInputDecorationType? decorationType,
- VoidCallback? onTap,
- FocusNode? focusNode,
- TextEditingController? textController,
- T? value,
- ValueNotifier<
T?> ? valueNotifier, - ValueChanged<
T?> ? onValueChanged, - List<
String? Function(T?)> ? rules, - Duration? validationDebounce,
- int rows = 1,
- TLabelPosition? labelPosition,
- TextInputType? keyboardType,
- List<
TextInputFormatter> ? inputFormatters,
Creates a text input field.
Implementation
const TTextField({
super.key,
this.label,
this.tag,
this.helperText,
this.info,
this.placeholder,
this.isRequired = false,
this.disabled = false,
this.autoFocus = false,
this.readOnly = false,
this.clearable = false,
this.obscureText = false,
this.theme,
this.preWidget,
this.postWidget,
this.size,
this.decorationType,
this.onTap,
this.focusNode,
this.textController,
this.value,
this.valueNotifier,
this.onValueChanged,
this.rules,
this.validationDebounce,
this.rows = 1,
this.labelPosition,
this.keyboardType,
this.inputFormatters,
}) : assert(
theme == null ||
(preWidget == null &&
postWidget == null &&
size == null &&
decorationType == null &&
obscureText == false &&
labelPosition == null),
'Cannot provide both theme and individual theme properties.',
),
assert(
!obscureText || rows == 1,
'Obscured fields cannot be multiline.',
);