CustomTextField constructor

CustomTextField({
  1. Key? key,
  2. dynamic onTapOutside(
    1. PointerDownEvent
    )?,
  3. required TextEditingController controller,
  4. required String hintText,
  5. bool isUnderLine = false,
  6. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  7. double? width,
  8. List<Locale>? hintLocales,
  9. TextSelectionControls? selectionControls,
  10. Radius? cursorRadius,
  11. bool? selectAllOnFocus,
  12. bool onTapAlwaysCalled = false,
  13. bool? ignorePointers,
  14. Color? cursorErrorColor,
  15. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  16. WidgetStatesController? statesController,
  17. TextMagnifierConfiguration? magnifierConfiguration,
  18. bool enableSuggestions = true,
  19. TapRegionUpCallback? onTapUpOutside,
  20. Widget? buildCounter(
    1. BuildContext, {
    2. required int currentLength,
    3. required bool isFocused,
    4. required int? maxLength,
    })?,
  21. bool stylusHandwritingEnabled = EditableText.defaultStylusHandwritingEnabled,
  22. bool canRequestFocus = true,
  23. bool scribbleEnabled = true,
  24. Object groupId = EditableText,
  25. Clip clipBehavior = Clip.hardEdge,
  26. UndoHistoryController? undoController,
  27. MouseCursor? mouseCursor,
  28. TextStyle? style,
  29. int? minLines = 1,
  30. SmartDashesType? smartDashesType = SmartDashesType.disabled,
  31. SmartQuotesType? smartQuotesType = SmartQuotesType.disabled,
  32. TextDirection? textDirection = TextDirection.ltr,
  33. Color? cursorColor,
  34. bool autocorrect = true,
  35. bool isCollapsed = false,
  36. ContentInsertionConfiguration? contentInsertionConfiguration,
  37. Brightness? keyboardAppearance,
  38. Widget? suffix,
  39. Widget? prefix,
  40. BoxBorder? border,
  41. bool expands = false,
  42. StrutStyle? strutStyle,
  43. List<TextInputFormatter>? inputFormatters,
  44. TextInputAction? textInputAction,
  45. double? contentPaddingHorizontal,
  46. Iterable<String>? autofillHints,
  47. Color? borderColor,
  48. BoxConstraints? prefixIconConstraints,
  49. BoxConstraints? suffixIconConstraints,
  50. int? maxLines,
  51. String? validator(
    1. String?
    )?,
  52. int? maxLength,
  53. dynamic onSaved(
    1. String?
    )?,
  54. double? fontSize,
  55. Color? textColor,
  56. TextCapitalization textCapitalization = TextCapitalization.none,
  57. double? hintTextFontSize,
  58. double? headingFontSize,
  59. String? headingText,
  60. String? subHeadingText,
  61. FontWeight? headingFontWeight,
  62. double? cursorHeight,
  63. bool? autofocus = false,
  64. bool readOnly = false,
  65. bool filled = true,
  66. double? contentPaddingVertical,
  67. double horizontalPadding = 0,
  68. double verticalPadding = 0,
  69. bool obscureText = false,
  70. Color? fillColor = MyColors.fillColor,
  71. Color? bgColor,
  72. Color? hintColor,
  73. double? borderRadius,
  74. TextInputType? keyboardType,
  75. dynamic onChanged(
    1. String
    )?,
  76. bool enabled = true,
  77. SpellCheckConfiguration? spellCheckConfiguration,
  78. double headingSpace = 0,
  79. String? suffixText,
  80. Color? focusedBorderColor,
  81. Widget contextMenuBuilder(
    1. BuildContext,
    2. EditableTextState
    )?,
  82. FocusNode? focusNode,
  83. bool enableInteractiveSelection = true,
  84. dynamic onTap()?,
  85. TextAlign textAlign = TextAlign.start,
  86. bool? showShadow = false,
  87. Color? headingColor,
  88. dynamic onFieldSubmitted(
    1. String
    )?,
  89. dynamic onEditingComplete()?,
  90. bool? showCursor = true,
  91. Widget errorBuilder(
    1. BuildContext,
    2. String
    )?,
  92. FloatingLabelAlignment? floatingLabelAlignment = FloatingLabelAlignment.start,
  93. String? errorText,
  94. TextStyle? errorStyle,
  95. InputBorder? errorBorder,
  96. Widget? counter,
  97. BoxConstraints? constraints,
  98. Widget? label,
  99. TextStyle? counterStyle,
  100. Widget? error,
  101. Widget? icon,
  102. ScrollPhysics? scrollPhysics,
  103. ScrollController? scrollController,
  104. void onAppPrivateCommand(
    1. String,
    2. Map<String, dynamic>
    )?,
  105. bool enableIMEPersonalizedLearning = true,
  106. double cursorWidth = 1.0,
  107. bool? cursorOpacityAnimates,
  108. AutovalidateMode? autovalidateMode,
  109. Widget? prefixIcon,
  110. bool? alignLabelWithHint,
  111. EdgeInsetsGeometry? contentPadding,
  112. String? counterText,
  113. InputBorder? disabledBorder,
  114. InputBorder? enabledBorder,
  115. int? errorMaxLines,
  116. FloatingLabelBehavior? floatingLabelBehavior,
  117. TextStyle? floatingLabelStyle,
  118. Color? focusColor,
  119. InputBorder? focusedBorder,
  120. InputBorder? focusedErrorBorder,
  121. Widget? helper,
  122. int? helperMaxLines,
  123. TextStyle? helperStyle,
  124. String? helperText,
  125. Widget? hint,
  126. Duration? hintFadeDuration,
  127. int? hintMaxLines,
  128. TextStyle? hintStyle,
  129. TextDirection? hintTextDirection,
  130. Color? hoverColor,
  131. Color? iconColor,
  132. bool? isDense,
  133. TextStyle? labelStyle,
  134. String? labelText,
  135. bool? maintainHintHeight,
  136. bool? maintainHintSize,
  137. Color? prefixIconColor,
  138. TextStyle? prefixStyle,
  139. String? restorationId,
  140. String? semanticCounterText,
  141. Widget? suffixIcon,
  142. Color? suffixIconColor,
  143. TextStyle? suffixStyle,
  144. VisualDensity? visualDensity,
})

this is the constructor of the CustomTextField

Implementation

CustomTextField({
  super.key,
  this.onTapOutside,
  required this.controller,
  required this.hintText,
  this.isUnderLine = false,
  this.dragStartBehavior = DragStartBehavior.start,
  this.width,
  this.hintLocales,
  this.selectionControls,
  this.cursorRadius,
  this.selectAllOnFocus,
  this.onTapAlwaysCalled = false,
  this.ignorePointers,
  this.cursorErrorColor,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.statesController,
  this.magnifierConfiguration,
  this.enableSuggestions = true,
  this.onTapUpOutside,
  this.buildCounter,
  this.stylusHandwritingEnabled =
      EditableText.defaultStylusHandwritingEnabled,
  this.canRequestFocus = true,
  this.scribbleEnabled = true,
  this.groupId = EditableText,
  this.clipBehavior = Clip.hardEdge,
  this.undoController,
  this.mouseCursor,
  this.style,
  this.minLines = 1,
  this.smartDashesType = SmartDashesType.disabled,
  this.smartQuotesType = SmartQuotesType.disabled,
  this.textDirection = TextDirection.ltr,
  this.cursorColor,
  this.autocorrect = true,
  this.isCollapsed = false,
  this.contentInsertionConfiguration,
  this.keyboardAppearance,
  this.suffix,
  this.prefix,
  this.border,
  this.expands = false,
  this.strutStyle,
  this.inputFormatters,
  this.textInputAction,
  this.contentPaddingHorizontal,
  this.autofillHints,
  this.borderColor,
  this.prefixIconConstraints,
  this.suffixIconConstraints,
  this.maxLines,
  this.validator,
  this.maxLength,
  this.onSaved,
  this.fontSize,
  this.textColor,
  this.textCapitalization = TextCapitalization.none,
  this.hintTextFontSize,
  this.headingFontSize,
  this.headingText,
  this.subHeadingText,
  this.headingFontWeight,
  this.cursorHeight,
  this.autofocus = false,
  this.readOnly = false,
  this.filled = true,
  this.contentPaddingVertical,
  this.horizontalPadding = 0,
  this.verticalPadding = 0,
  this.obscureText = false,
  this.fillColor = MyColors.fillColor,
  this.bgColor,
  this.hintColor,
  double? borderRadius,
  this.keyboardType,
  this.onChanged,
  this.enabled = true,
  this.spellCheckConfiguration,
  this.headingSpace = 0,
  this.suffixText,
  this.focusedBorderColor,
  this.contextMenuBuilder,
  this.focusNode,
  this.enableInteractiveSelection = true,
  this.onTap,
  this.textAlign = TextAlign.start,
  this.showShadow = false,
  this.headingColor,
  this.onFieldSubmitted,
  this.onEditingComplete,
  this.showCursor = true,
  this.errorBuilder,
  this.floatingLabelAlignment = FloatingLabelAlignment.start,
  this.errorText,
  this.errorStyle,
  this.errorBorder,
  this.counter,
  this.constraints,
  this.label,
  this.counterStyle,
  this.error,
  this.icon,
  this.scrollPhysics,
  this.scrollController,
  this.onAppPrivateCommand,
  this.enableIMEPersonalizedLearning = true,
  this.cursorWidth = 1.0,
  this.cursorOpacityAnimates,
  this.autovalidateMode,
  this.prefixIcon,
  this.alignLabelWithHint,
  this.contentPadding,
  this.counterText,
  this.disabledBorder,
  this.enabledBorder,
  this.errorMaxLines,
  this.floatingLabelBehavior,
  this.floatingLabelStyle,
  this.focusColor,
  this.focusedBorder,
  this.focusedErrorBorder,
  this.helper,
  this.helperMaxLines,
  this.helperStyle,
  this.helperText,
  this.hint,
  this.hintFadeDuration,
  this.hintMaxLines,
  this.hintStyle,
  this.hintTextDirection,
  this.hoverColor,
  this.iconColor,
  this.isDense,
  this.labelStyle,
  this.labelText,
  this.maintainHintHeight,
  this.maintainHintSize,
  this.prefixIconColor,
  this.prefixStyle,
  this.restorationId,
  this.semanticCounterText,
  this.suffixIcon,
  this.suffixIconColor,
  this.suffixStyle,
  this.visualDensity,
}) : borderRadius = borderRadius ?? CustomStylesConfig.globalBorderRadius;