CustomTextField constructor

const CustomTextField({
  1. Key? key,
  2. double? height,
  3. double? width,
  4. EdgeInsets? margin,
  5. EdgeInsets? padding,
  6. bool disabled = false,
  7. bool obscureText = false,
  8. bool autocorrect = false,
  9. bool dense = false,
  10. bool filled = false,
  11. bool alignLabelWithHint = true,
  12. bool singleLine = false,
  13. bool noSpace = false,
  14. Color? backgroundColor,
  15. Color? borderColor,
  16. BorderRadius? borderRadius,
  17. BorderSide? enabledBorderSide,
  18. BorderSide? focusedBorderSide,
  19. BorderSide? disabledBorderSide,
  20. int? flex,
  21. int? minLines = 1,
  22. int? maxLines = 1,
  23. int? maxLength,
  24. String? initialValue,
  25. String? hintText,
  26. String? labelText,
  27. TextStyle? style,
  28. TextStyle? hintStyle,
  29. TextStyle? labelStyle,
  30. TextStyle? floatingLabelStyle,
  31. TextAlign textAlign = TextAlign.start,
  32. Widget? prefix,
  33. Widget? prefixIcon,
  34. Widget? suffix,
  35. Widget? suffixIcon,
  36. Widget? counter,
  37. TextEditingController? controller,
  38. TextInputType? keyboardType,
  39. TextCapitalization textCapitalization = TextCapitalization.sentences,
  40. InputFormat? inputFormat,
  41. List<TextInputFormatter> inputFormatters = const [],
  42. FocusNode? focusNode,
  43. Function? onEditingComplete,
  44. Function? onChanged,
  45. Function? validator,
})

Implementation

const CustomTextField({
  super.key,

  this.height,
  this.width,

  this.margin,
  this.padding,

  this.disabled = false,
  this.obscureText = false,
  this.autocorrect = false,
  this.dense = false,
  this.filled = false,
  this.alignLabelWithHint = true,
  this.singleLine = false,
  this.noSpace = false,

  this.backgroundColor,
  this.borderColor,

  this.borderRadius,
  this.enabledBorderSide,
  this.focusedBorderSide,
  this.disabledBorderSide,

  this.flex,
  this.minLines = 1,
  this.maxLines = 1,
  this.maxLength,

  this.initialValue,
  this.hintText,
  this.labelText,
  this.style,
  this.hintStyle,
  this.labelStyle,
  this.floatingLabelStyle,

  this.textAlign = TextAlign.start,

  this.prefix,
  this.prefixIcon,
  this.suffix,
  this.suffixIcon,
  this.counter,

  this.controller,
  this.keyboardType,
  this.textCapitalization = TextCapitalization.sentences,
  this.inputFormat,
  this.inputFormatters = const [],
  this.focusNode,
  this.onEditingComplete,
  this.onChanged,
  this.validator

}) : assert(
      (controller == null) || (initialValue == null),
      "Solo se puede recibir uno de los dos atributos: 'controller' o 'initialValue', pero no ambos."
    ),
    assert(
      (width == null) || (flex == null),
      "Solo se puede recibir uno de los dos atributos: 'width' o 'flex', pero no ambos."
    );