TextInput constructor

const TextInput({
  1. Key? key,
  2. String? labelText,
  3. String? initialValue,
  4. TextInputType? keyboardType,
  5. int? maxCharsInLine,
  6. int maxLines = 1,
  7. int? maxLength,
  8. bool hExpandable = false,
  9. bool vExpandable = false,
  10. List<DropdownListItem>? options,
  11. bool isOptionEditable = true,
  12. bool isRequired = false,
  13. bool readOnly = false,
  14. bool enabled = true,
  15. bool fixedHeight = true,
  16. InputIcon? leadingIcon,
  17. InputIcon? trailingIcon,
  18. TextStyle? textStyle,
  19. Color? focusedBorderColor,
  20. FocusNode? focusNode,
  21. TextEditingController? controller,
  22. List<TextInputFormatter>? inputFormatters,
  23. Validator? validator,
  24. ValidatedValueChanged<String?>? onChanged,
  25. ValueChanged<String>? onEnter,
  26. 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',
      );