InputField constructor

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

Default Text Field

Implementation

const InputField({
  super.key,
  required this.controller,
  this.labelText,
  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.suffixIcon,
  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.',
     );