ShadTextareaFormField constructor

ShadTextareaFormField({
  1. Key? key,
  2. String? id,
  3. FormFieldSetter<String>? onSaved,
  4. String? forceErrorText,
  5. String? validator(
    1. String
    )?,
  6. String? initialValue,
  7. bool enabled = true,
  8. AutovalidateMode? autovalidateMode,
  9. String? restorationId,
  10. TextEditingController? controller,
  11. Widget? label,
  12. Widget error(
    1. String error
    )?,
  13. Widget? description,
  14. @Deprecated('Use toValueTransformer instead') ToValueTransformer<String?>? valueTransformer,
  15. ToValueTransformer<String?>? toValueTransformer,
  16. FromValueTransformer<String?>? fromValueTransformer,
  17. VoidCallback? onReset,
  18. FocusNode? focusNode,
  19. void onChanged(
    1. String
    )?,
  20. ShadDecoration? decoration,
  21. Widget? placeholder,
  22. TextStyle? placeholderStyle,
  23. AlignmentGeometry? alignment,
  24. AlignmentGeometry? placeholderAlignment,
  25. EdgeInsetsGeometry? padding,
  26. EdgeInsetsGeometry? inputPadding,
  27. double? gap,
  28. BoxConstraints? constraints,
  29. MainAxisAlignment? mainAxisAlignment,
  30. CrossAxisAlignment? crossAxisAlignment,
  31. bool readOnly = false,
  32. bool autofocus = false,
  33. bool? showCursor,
  34. bool onPressedAlwaysCalled = false,
  35. TapRegionCallback? onPressedOutside,
  36. GestureTapCallback? onPressed,
  37. ScrollController? scrollController,
  38. ScrollPhysics? scrollPhysics,
  39. MouseCursor? mouseCursor,
  40. TextMagnifierConfiguration magnifierConfiguration = TextMagnifierConfiguration.disabled,
  41. double? cursorWidth,
  42. double? cursorHeight,
  43. Radius? cursorRadius,
  44. bool? cursorOpacityAnimates,
  45. Color? cursorColor,
  46. Color? selectionColor,
  47. Brightness? keyboardAppearance,
  48. TextDirection? textDirection,
  49. TextAlign textAlign = TextAlign.start,
  50. VoidCallback? onEditingComplete,
  51. ValueChanged<String>? onSubmitted,
  52. AppPrivateCommandCallback? onAppPrivateCommand,
  53. TextStyle? style,
  54. StrutStyle? strutStyle,
  55. bool scribbleEnabled = true,
  56. bool stylusHandwritingEnabled = true,
  57. bool enableIMEPersonalizedLearning = true,
  58. EditableTextContextMenuBuilder? contextMenuBuilder,
  59. SpellCheckConfiguration? spellCheckConfiguration,
  60. ContentInsertionConfiguration? contentInsertionConfiguration,
  61. TextSelectionControls? selectionControls,
  62. bool? enableInteractiveSelection,
  63. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  64. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  65. Clip clipBehavior = Clip.hardEdge,
  66. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  67. double minHeight = 80,
  68. double maxHeight = 500,
  69. bool resizable = true,
  70. ValueChanged<double>? onHeightChanged,
  71. WidgetBuilder? resizeHandleBuilder,
  72. Object? groupId,
  73. WidgetBuilder? keyboardToolbarBuilder,
  74. Widget? leading,
  75. Widget? trailing,
  76. Widget? top,
  77. Widget? bottom,
  78. ValueChanged<int>? onLineCountChange,
  79. double? verticalGap,
  80. bool? useBrowserContextMenu,
  81. ValueChanged<List<ShadClipboardItem>>? onPasteFiles,
  82. ValueChanged<Object>? onPasteFilesError,
})

Implementation

ShadTextareaFormField({
  super.key,
  super.id,
  super.onSaved,
  super.forceErrorText,
  String? Function(String)? validator,
  String? initialValue,
  super.enabled,
  super.autovalidateMode,
  super.restorationId,
  this.controller,
  super.label,
  super.error,
  super.description,
  @Deprecated('Use toValueTransformer instead') super.valueTransformer,
  super.toValueTransformer,
  super.fromValueTransformer,
  super.onReset,
  super.focusNode,
  void Function(String)? onChanged,

  /// {@macro ShadTextarea.decoration}
  ShadDecoration? decoration,

  /// {@macro ShadTextarea.placeholder}
  Widget? placeholder,

  /// {@macro ShadTextarea.placeholderStyle}
  TextStyle? placeholderStyle,

  /// {@macro ShadTextarea.alignment}
  AlignmentGeometry? alignment,

  /// {@macro ShadTextarea.placeholderAlignment}
  AlignmentGeometry? placeholderAlignment,

  /// {@macro ShadTextarea.padding}
  EdgeInsetsGeometry? padding,

  /// {@macro ShadTextarea.inputPadding}
  EdgeInsetsGeometry? inputPadding,

  /// {@macro ShadTextarea.gap}
  double? gap,

  /// {@macro ShadTextarea.constraints}
  BoxConstraints? constraints,

  /// {@macro ShadTextarea.mainAxisAlignment}
  MainAxisAlignment? mainAxisAlignment,

  /// {@macro ShadTextarea.crossAxisAlignment}
  CrossAxisAlignment? crossAxisAlignment,

  /// {@macro ShadTextarea.readOnly}
  bool readOnly = false,

  /// {@macro ShadTextarea.autofocus}
  bool autofocus = false,

  /// {@macro ShadTextarea.showCursor}
  bool? showCursor,

  /// {@macro ShadTextarea.onPressedAlwaysCalled}
  bool onPressedAlwaysCalled = false,

  /// {@macro ShadTextarea.onPressedOutside}
  TapRegionCallback? onPressedOutside,

  /// {@macro ShadTextarea.onPressed}
  GestureTapCallback? onPressed,

  /// {@macro ShadTextarea.scrollController}
  ScrollController? scrollController,

  /// {@macro ShadTextarea.scrollPhysics}
  ScrollPhysics? scrollPhysics,

  /// {@macro ShadTextarea.mouseCursor}
  MouseCursor? mouseCursor,

  /// {@macro ShadTextarea.magnifierConfiguration}
  TextMagnifierConfiguration magnifierConfiguration =
      TextMagnifierConfiguration.disabled,

  /// {@macro ShadTextarea.cursorWidth}
  double? cursorWidth,

  /// {@macro ShadTextarea.cursorHeight}
  double? cursorHeight,

  /// {@macro ShadTextarea.cursorRadius}
  Radius? cursorRadius,

  /// {@macro ShadTextarea.cursorOpacityAnimates}
  bool? cursorOpacityAnimates,

  /// {@macro ShadTextarea.cursorColor}
  Color? cursorColor,

  /// {@macro ShadTextarea.selectionColor}
  Color? selectionColor,

  /// {@macro ShadTextarea.keyboardAppearance}
  Brightness? keyboardAppearance,

  /// {@macro ShadTextarea.textDirection}
  TextDirection? textDirection,

  /// {@macro ShadTextarea.textAlign}
  TextAlign textAlign = TextAlign.start,

  /// {@macro ShadTextarea.onEditingComplete}
  VoidCallback? onEditingComplete,

  /// {@macro ShadTextarea.onSubmitted}
  ValueChanged<String>? onSubmitted,

  /// {@macro ShadTextarea.onAppPrivateCommand}
  AppPrivateCommandCallback? onAppPrivateCommand,

  /// {@macro ShadTextarea.style}
  TextStyle? style,

  /// {@macro ShadTextarea.strutStyle}
  StrutStyle? strutStyle,

  /// {@macro ShadTextarea.scribbleEnabled}
  bool scribbleEnabled = true,

  /// {@macro ShadTextarea.stylusHandwritingEnabled}
  bool stylusHandwritingEnabled = true,

  /// {@macro ShadTextarea.enableIMEPersonalizedLearning}
  bool enableIMEPersonalizedLearning = true,

  /// {@macro ShadTextarea.contextMenuBuilder}
  EditableTextContextMenuBuilder? contextMenuBuilder,

  /// {@macro ShadTextarea.spellCheckConfiguration}
  SpellCheckConfiguration? spellCheckConfiguration,

  /// {@macro ShadTextarea.contentInsertionConfiguration}
  ContentInsertionConfiguration? contentInsertionConfiguration,

  /// {@macro ShadTextarea.selectionControls}
  TextSelectionControls? selectionControls,

  /// {@macro ShadTextarea.enableInteractiveSelection}
  bool? enableInteractiveSelection,

  /// {@macro ShadTextarea.selectionHeightStyle}
  ui.BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,

  /// {@macro ShadTextarea.selectionWidthStyle}
  ui.BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,

  /// {@macro ShadTextarea.clipBehavior}
  Clip clipBehavior = Clip.hardEdge,

  /// {@macro ShadTextarea.dragStartBehavior}
  DragStartBehavior dragStartBehavior = DragStartBehavior.start,

  /// {@macro ShadTextarea.minHeight}
  double minHeight = 80,

  /// {@macro ShadTextarea.maxHeight}
  double maxHeight = 500,

  /// {@macro ShadTextarea.resizable}
  bool resizable = true,

  /// {@macro ShadTextarea.onHeightChanged}
  ValueChanged<double>? onHeightChanged,

  /// {@macro ShadTextarea.resizeHandleBuilder}
  WidgetBuilder? resizeHandleBuilder,

  /// {@macro ShadTextarea.groupId}
  Object? groupId,

  /// {@macro ShadKeyboardToolbar.toolbarBuilder}
  WidgetBuilder? keyboardToolbarBuilder,

  /// {@macro ShadInput.leading}
  Widget? leading,

  /// {@macro ShadInput.trailing}
  Widget? trailing,

  /// {@macro ShadInput.top}
  Widget? top,

  /// {@macro ShadInput.bottom}
  Widget? bottom,

  /// {@macro ShadInput.onLineCountChange}
  ValueChanged<int>? onLineCountChange,

  /// {@macro ShadInput.verticalGap}
  double? verticalGap,

  /// {@macro ShadInput.useBrowserContextMenu}
  bool? useBrowserContextMenu,

  /// {@macro ShadInput.onPasteFiles}
  ValueChanged<List<ShadClipboardItem>>? onPasteFiles,

  /// {@macro ShadInput.onPasteFilesError}
  ValueChanged<Object>? onPasteFilesError,
}) : super(
       initialValue: controller != null ? controller.text : initialValue,
       validator: validator == null ? null : (v) => validator(v ?? ''),
       onChanged: onChanged == null ? null : (v) => onChanged(v ?? ''),
       decorationBuilder: (context) =>
           (ShadTheme.of(context).inputTheme.decoration ??
                   const ShadDecoration())
               .merge(decoration),
       builder: (state) {
         state as ShadFormBuilderTextareaState;
         return ShadTextarea(
           key: state.textareaKey,
           controller: state.controller,
           restorationId: restorationId,
           enabled: state.enabled,
           focusNode: state.focusNode,
           readOnly: readOnly,
           decoration: state.decoration,
           style: style,
           cursorColor: cursorColor,
           selectionColor: selectionColor,
           textAlign: textAlign,
           textDirection: textDirection,
           keyboardAppearance: keyboardAppearance,
           autofocus: autofocus,
           showCursor: showCursor,
           placeholder: placeholder,
           placeholderStyle: placeholderStyle,
           placeholderAlignment: placeholderAlignment,
           alignment: alignment,
           padding: padding,
           inputPadding: inputPadding,
           gap: gap,
           constraints: constraints,
           mainAxisAlignment: mainAxisAlignment,
           crossAxisAlignment: crossAxisAlignment,
           onEditingComplete: onEditingComplete,
           onSubmitted: onSubmitted,
           onAppPrivateCommand: onAppPrivateCommand,
           scrollController: scrollController,
           scrollPhysics: scrollPhysics,
           mouseCursor: mouseCursor,
           magnifierConfiguration: magnifierConfiguration,
           cursorWidth: cursorWidth,
           cursorHeight: cursorHeight,
           cursorRadius: cursorRadius,
           cursorOpacityAnimates: cursorOpacityAnimates,
           scribbleEnabled: scribbleEnabled,
           stylusHandwritingEnabled: stylusHandwritingEnabled,
           enableIMEPersonalizedLearning: enableIMEPersonalizedLearning,
           contextMenuBuilder: contextMenuBuilder,
           spellCheckConfiguration: spellCheckConfiguration,
           contentInsertionConfiguration: contentInsertionConfiguration,
           selectionControls: selectionControls,
           enableInteractiveSelection: enableInteractiveSelection,
           selectionHeightStyle: selectionHeightStyle,
           selectionWidthStyle: selectionWidthStyle,
           clipBehavior: clipBehavior,
           dragStartBehavior: dragStartBehavior,
           onPressed: onPressed,
           onPressedAlwaysCalled: onPressedAlwaysCalled,
           onPressedOutside: onPressedOutside,
           minHeight: minHeight,
           maxHeight: maxHeight,
           resizable: resizable,
           onHeightChanged: onHeightChanged,
           resizeHandleBuilder: resizeHandleBuilder,
           strutStyle: strutStyle,
           groupId: groupId,
           keyboardToolbarBuilder: keyboardToolbarBuilder,
           top: top,
           bottom: bottom,
           leading: leading,
           trailing: trailing,
           onLineCountChange: onLineCountChange,
           verticalGap: verticalGap,
           useBrowserContextMenu: useBrowserContextMenu,
           onPasteFiles: onPasteFiles,
           onPasteFilesError: onPasteFilesError,
         );
       },
     );