TextField constructor

const TextField({
  1. Key? key,
  2. String? label,
  3. Widget? labelWidget,
  4. bool appendColonToLabel = true,
  5. TextStyle? labelStyle,
  6. String? hintText,
  7. FocusNode? focusNode,
  8. String? errorText,
  9. bool enabled = true,
  10. bool readOnly = false,
  11. Widget? suffix,
  12. Widget? suffixIcon,
  13. Widget? prefix,
  14. Widget? prefixIcon,
  15. bool obscureText = false,
  16. bool? filled,
  17. BorderRadius? borderRadius,
  18. TextEditingController? controller,
  19. List<InputFeedbackText>? feedback,
  20. TextInputType? keyboardType,
  21. List<TextInputFormatter>? inputFormatters,
  22. TextCapitalization textCapitalization = material.TextCapitalization.none,
  23. TextAlign textAlign = material.TextAlign.start,
  24. TextInputAction? textInputAction,
  25. int? maxLength,
  26. int? maxLines = 1,
  27. int? minLines,
  28. bool? expands,
  29. TextStyle? textStyle,
  30. void onChanged(
    1. String value
    )?,
  31. InputDecoration? decoration,
  32. bool overrideDecoration = false,
  33. TextAlignVertical? textAlignVertical,
  34. WrapWidgetBuilder? innerBoxWrapper,
  35. ValueChanged<String>? onSubmitted,
  36. EdgeInsets scrollPadding = const EdgeInsets.all(10),
  37. bool? autocorrect,
  38. double? cursorHeight,
  39. bool forceErrorStyle = false,
  40. bool? showCursor,
  41. Iterable<String>? autofillHints = const [],
  42. TapRegionCallback? onTapOutside,
  43. TapRegionUpCallback? onTapUpOutside,
  44. VoidCallback? onTap,
  45. bool autofocus = false,
  46. bool canRequestFocus = true,
  47. bool enableSuggestions = true,
  48. InputCounterWidgetBuilder? buildCounter,
  49. EditableTextContextMenuBuilder? contextMenuBuilder,
  50. Clip clipBehavior = material.Clip.none,
  51. Color? cursorColor,
  52. double cursorWidth = 2.0,
  53. Radius? cursorRadius,
  54. bool cursorOpacityAnimates = true,
  55. MouseCursor? mouseCursor,
  56. SpellCheckConfiguration? spellCheckConfiguration,
})

Implementation

const TextField({
  Key? key,
  this.label,
  this.labelWidget,
  this.appendColonToLabel = true,
  this.labelStyle,
  this.hintText,
  this.focusNode,
  this.errorText,
  this.enabled = true,
  this.readOnly = false,
  this.suffix,
  this.suffixIcon,
  this.prefix,
  this.prefixIcon,
  this.obscureText = false,
  this.filled,
  this.borderRadius,
  this.controller,
  this.feedback,
  this.keyboardType,
  this.inputFormatters,
  this.textCapitalization = material.TextCapitalization.none,
  this.textAlign = material.TextAlign.start,
  this.textInputAction,
  this.maxLength,
  this.maxLines = 1,
  this.minLines,
  this.expands,
  this.textStyle,
  this.onChanged,
  this.decoration,
  this.overrideDecoration = false,
  this.textAlignVertical,
  this.innerBoxWrapper,
  this.onSubmitted,
  this.scrollPadding = const EdgeInsets.all(10),
  this.autocorrect,
  this.cursorHeight,
  this.forceErrorStyle = false,
  this.showCursor,
  this.autofillHints = const [],
  this.onTapOutside,
  this.onTapUpOutside,
  this.onTap,
  this.autofocus = false,
  this.canRequestFocus = true,
  this.enableSuggestions = true,
  this.buildCounter,
  this.contextMenuBuilder,
  this.clipBehavior = material.Clip.none,
  this.cursorColor,
  this.cursorWidth = 2.0,
  this.cursorRadius,
  this.cursorOpacityAnimates = true,
  this.mouseCursor,
  this.spellCheckConfiguration,
})  : assert(
        label == null || labelWidget == null,
        'You cannot provide both `label` and `labelWidget` at the same time. '
        'Use only one of them.',
      ),
      super(key: key);