TUIInputField constructor

const TUIInputField({
  1. Key? key,
  2. bool enabled = true,
  3. bool readOnly = false,
  4. String? hintText,
  5. String? labelText = 'Label',
  6. String? errorText,
  7. String? helperText,
  8. String? prefixText,
  9. String? suffixText,
  10. TextAlign textAlign = TextAlign.start,
  11. TextAlignVertical? textAlignVertical = TextAlignVertical.center,
  12. TextCapitalization textCapitalization = TextCapitalization.none,
  13. TextDirection? textDirection = TextDirection.ltr,
  14. int? maxLines = 1,
  15. int? minLines,
  16. bool expands = false,
  17. int? maxLength,
  18. Icon? prefixIcon,
  19. Color? prefixIconColor = TUIDefaultColors.inputText,
  20. Icon? suffixIcon,
  21. Color? suffixIconColor = TUIDefaultColors.inputText,
  22. bool obscureText = false,
  23. String obscuringCharacter = '*',
  24. TextEditingController? controller,
  25. TextInputType? keyboardType,
  26. TextInputAction? textInputAction,
  27. void onChanged(
    1. String
    )?,
  28. void onEditingComplete()?,
  29. void onSubmitted(
    1. String
    )?,
  30. 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);