CustomTextField constructor
CustomTextField({
- Key? key,
- dynamic onTapOutside()?,
- required TextEditingController controller,
- required String hintText,
- bool isUnderLine = false,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- double? width,
- List<
Locale> ? hintLocales, - TextSelectionControls? selectionControls,
- Radius? cursorRadius,
- bool? selectAllOnFocus,
- bool onTapAlwaysCalled = false,
- bool? ignorePointers,
- Color? cursorErrorColor,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- WidgetStatesController? statesController,
- TextMagnifierConfiguration? magnifierConfiguration,
- bool enableSuggestions = true,
- TapRegionUpCallback? onTapUpOutside,
- Widget? buildCounter(
- BuildContext, {
- required int currentLength,
- required bool isFocused,
- required int? maxLength,
- bool stylusHandwritingEnabled = EditableText.defaultStylusHandwritingEnabled,
- bool canRequestFocus = true,
- bool scribbleEnabled = true,
- Object groupId = EditableText,
- Clip clipBehavior = Clip.hardEdge,
- UndoHistoryController? undoController,
- MouseCursor? mouseCursor,
- TextStyle? style,
- int? minLines = 1,
- SmartDashesType? smartDashesType = SmartDashesType.disabled,
- SmartQuotesType? smartQuotesType = SmartQuotesType.disabled,
- TextDirection? textDirection = TextDirection.ltr,
- Color? cursorColor,
- bool autocorrect = true,
- bool isCollapsed = false,
- ContentInsertionConfiguration? contentInsertionConfiguration,
- Brightness? keyboardAppearance,
- Widget? suffix,
- Widget? prefix,
- BoxBorder? border,
- bool expands = false,
- StrutStyle? strutStyle,
- List<
TextInputFormatter> ? inputFormatters, - TextInputAction? textInputAction,
- double? contentPaddingHorizontal,
- Iterable<
String> ? autofillHints, - Color? borderColor,
- BoxConstraints? prefixIconConstraints,
- BoxConstraints? suffixIconConstraints,
- int? maxLines,
- String? validator()?,
- int? maxLength,
- dynamic onSaved()?,
- double? fontSize,
- Color? textColor,
- TextCapitalization textCapitalization = TextCapitalization.none,
- double? hintTextFontSize,
- double? headingFontSize,
- String? headingText,
- String? subHeadingText,
- FontWeight? headingFontWeight,
- double? cursorHeight,
- bool? autofocus = false,
- bool readOnly = false,
- bool filled = true,
- double? contentPaddingVertical,
- double horizontalPadding = 0,
- double verticalPadding = 0,
- bool obscureText = false,
- Color? fillColor = MyColors.fillColor,
- Color? bgColor,
- Color? hintColor,
- double? borderRadius,
- TextInputType? keyboardType,
- dynamic onChanged()?,
- bool enabled = true,
- SpellCheckConfiguration? spellCheckConfiguration,
- double headingSpace = 0,
- String? suffixText,
- Color? focusedBorderColor,
- Widget contextMenuBuilder()?,
- FocusNode? focusNode,
- bool enableInteractiveSelection = true,
- dynamic onTap()?,
- TextAlign textAlign = TextAlign.start,
- bool? showShadow = false,
- Color? headingColor,
- dynamic onFieldSubmitted()?,
- dynamic onEditingComplete()?,
- bool? showCursor = true,
- Widget errorBuilder()?,
- FloatingLabelAlignment? floatingLabelAlignment = FloatingLabelAlignment.start,
- String? errorText,
- TextStyle? errorStyle,
- InputBorder? errorBorder,
- Widget? counter,
- BoxConstraints? constraints,
- Widget? label,
- TextStyle? counterStyle,
- Widget? error,
- Widget? icon,
- ScrollPhysics? scrollPhysics,
- ScrollController? scrollController,
- void onAppPrivateCommand()?,
- bool enableIMEPersonalizedLearning = true,
- double cursorWidth = 1.0,
- bool? cursorOpacityAnimates,
- AutovalidateMode? autovalidateMode,
- Widget? prefixIcon,
- bool? alignLabelWithHint,
- EdgeInsetsGeometry? contentPadding,
- String? counterText,
- InputBorder? disabledBorder,
- InputBorder? enabledBorder,
- int? errorMaxLines,
- FloatingLabelBehavior? floatingLabelBehavior,
- TextStyle? floatingLabelStyle,
- Color? focusColor,
- InputBorder? focusedBorder,
- InputBorder? focusedErrorBorder,
- Widget? helper,
- int? helperMaxLines,
- TextStyle? helperStyle,
- String? helperText,
- Widget? hint,
- Duration? hintFadeDuration,
- int? hintMaxLines,
- TextStyle? hintStyle,
- TextDirection? hintTextDirection,
- Color? hoverColor,
- Color? iconColor,
- bool? isDense,
- TextStyle? labelStyle,
- String? labelText,
- bool? maintainHintHeight,
- bool? maintainHintSize,
- Color? prefixIconColor,
- TextStyle? prefixStyle,
- String? restorationId,
- String? semanticCounterText,
- Widget? suffixIcon,
- Color? suffixIconColor,
- TextStyle? suffixStyle,
- 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;