InputField constructor

const InputField({
  1. Key? key,
  2. required TextEditingController controller,
  3. String? labelText,
  4. FieldLabelPosition? labelPosition,
  5. bool obscureText = false,
  6. bool autoFocus = false,
  7. TextInputType keyboardType = TextInputType.text,
  8. TextAlign? textAlign,
  9. int? maxLines = 1,
  10. bool? validateOnFocusChange = true,
  11. dynamic handleValidationError(
    1. FormValidationResult handleError
    )?,
  12. int? minLines,
  13. bool enableSuggestions = true,
  14. String? hintText,
  15. TextStyle? hintStyle,
  16. FocusNode? focusNode,
  17. FormValidator? formValidator,
  18. FormValidatorCallback? validate,
  19. String? dummyData,
  20. dynamic onChanged(
    1. String value
    )?,
  21. TextStyle? style,
  22. StrutStyle? strutStyle,
  23. TextInputAction? textInputAction,
  24. bool readOnly = false,
  25. bool? showCursor,
  26. int? maxLength,
  27. bool? enabled,
  28. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  29. double? cursorHeight,
  30. Radius? cursorRadius,
  31. Color? cursorColor,
  32. GestureTapCallback? onTap,
  33. TapRegionCallback? onTapOutside,
  34. MouseCursor? mouseCursor,
  35. TextCapitalization textCapitalization = TextCapitalization.none,
  36. MaxLengthEnforcement? maxLengthEnforcement,
  37. double cursorWidth = 2.0,
  38. AppPrivateCommandCallback? onAppPrivateCommand,
  39. List<TextInputFormatter>? inputFormatters,
  40. bool expands = false,
  41. TextAlignVertical? textAlignVertical,
  42. TextDirection? textDirection,
  43. String obscuringCharacter = '•',
  44. bool autocorrect = true,
  45. SmartDashesType? smartDashesType,
  46. SmartQuotesType? smartQuotesType,
  47. InputDecoration? decoration,
  48. VoidCallback? onEditingComplete,
  49. Brightness? keyboardAppearance,
  50. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  51. TextSelectionControls? selectionControls,
  52. ValueChanged<String>? onSubmitted,
  53. ScrollController? scrollController,
  54. ScrollPhysics? scrollPhysics,
  55. Iterable<String>? autofillHints = const <String>[],
  56. Clip clipBehavior = Clip.hardEdge,
  57. bool? passwordVisible,
  58. bool? passwordViewable,
  59. Widget? prefixIcon,
  60. PrefixIconAlignment prefixIconAlignment = PrefixIconAlignment.center,
  61. Widget? suffixIcon,
  62. SuffixIconAlignment suffixIconAlignment = SuffixIconAlignment.center,
  63. Color? backgroundColor,
  64. BorderRadius? borderRadius,
  65. InputBorder? border,
  66. InputBorder? focusedBorder,
  67. InputBorder? enabledBorder,
  68. EdgeInsetsGeometry? contentPadding,
  69. TextStyle? labelStyle,
  70. Widget? header,
  71. Widget? footer,
  72. bool? clearable,
  73. Widget? clearIcon,
  74. String? mask,
  75. String? maskMatch,
  76. bool? maskedReturnValue,
  77. DecoratorTextField? decorator,
  78. Field? field,
  79. String? stateName,
  80. bool enableInteractiveSelection = true,
})

Default Text Field

Implementation

const InputField({
  super.key,
  required this.controller,
  this.labelText,
  this.labelPosition,
  this.obscureText = false,
  this.autoFocus = false,
  this.keyboardType = TextInputType.text,
  this.textAlign,
  this.maxLines = 1,
  this.validateOnFocusChange = true,
  this.handleValidationError,
  this.minLines,
  this.enableSuggestions = true,
  this.hintText,
  this.hintStyle,
  this.focusNode,
  this.formValidator,
  this.validate,
  this.dummyData,
  this.onChanged,
  this.style,
  this.strutStyle,
  this.textInputAction,
  this.readOnly = false,
  this.showCursor,
  this.maxLength,
  this.enabled,
  this.dragStartBehavior = DragStartBehavior.start,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorColor,
  this.onTap,
  this.onTapOutside,
  this.mouseCursor,
  this.textCapitalization = TextCapitalization.none,
  this.maxLengthEnforcement,
  this.cursorWidth = 2.0,
  this.onAppPrivateCommand,
  this.inputFormatters,
  this.expands = false,
  this.textAlignVertical,
  this.textDirection,
  this.obscuringCharacter = '•',
  this.autocorrect = true,
  this.smartDashesType,
  this.smartQuotesType,
  this.decoration,
  this.onEditingComplete,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.selectionControls,
  this.onSubmitted,
  this.scrollController,
  this.scrollPhysics,
  this.autofillHints = const <String>[],
  this.clipBehavior = Clip.hardEdge,
  this.passwordVisible,
  this.passwordViewable,
  this.prefixIcon,
  this.prefixIconAlignment = PrefixIconAlignment.center,
  this.suffixIcon,
  this.suffixIconAlignment = SuffixIconAlignment.center,
  this.backgroundColor,
  this.borderRadius,
  this.border,
  this.focusedBorder,
  this.enabledBorder,
  this.contentPadding,
  this.labelStyle,
  this.header,
  this.footer,
  this.clearable,
  this.clearIcon,
  this.mask,
  this.maskMatch,
  this.maskedReturnValue,
  this.decorator,
  this.field,
  this.stateName,
  this.enableInteractiveSelection = true,
}) : assert(
       formValidator == null || validate == null,
       'Provide either formValidator or validate, not both.',
     );