TTextField<T extends String?> constructor

const TTextField<T extends String?>({
  1. Key? key,
  2. String? label,
  3. String? tag,
  4. String? helperText,
  5. String? info,
  6. String? placeholder,
  7. bool isRequired = false,
  8. bool disabled = false,
  9. bool autoFocus = false,
  10. bool readOnly = false,
  11. bool clearable = false,
  12. bool obscureText = false,
  13. TTextFieldTheme? theme,
  14. Widget? preWidget,
  15. Widget? postWidget,
  16. TInputSize? size,
  17. TInputDecorationType? decorationType,
  18. VoidCallback? onTap,
  19. FocusNode? focusNode,
  20. TextEditingController? textController,
  21. T? value,
  22. ValueNotifier<T?>? valueNotifier,
  23. ValueChanged<T?>? onValueChanged,
  24. List<String? Function(T?)>? rules,
  25. Duration? validationDebounce,
  26. int rows = 1,
  27. TLabelPosition? labelPosition,
  28. TextInputType? keyboardType,
  29. 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.',
      );