CellTextField constructor

const CellTextField({
  1. Key? key,
  2. required MutableCell<String> content,
  3. MutableCell<TextSelection>? selection,
  4. ValueCell<FocusNode?>? focusNode,
  5. ValueCell<InputDecoration?> decoration = const ValueCell.value(InputDecoration()),
  6. ValueCell<TextInputType?>? keyboardType,
  7. ValueCell<TextInputAction?>? textInputAction,
  8. ValueCell<TextCapitalization> textCapitalization = const ValueCell.value(TextCapitalization.none),
  9. ValueCell<TextStyle?>? style,
  10. ValueCell<StrutStyle?>? strutStyle,
  11. ValueCell<TextAlign> textAlign = const ValueCell.value(TextAlign.start),
  12. ValueCell<TextAlignVertical?>? textAlignVertical,
  13. ValueCell<TextDirection?>? textDirection,
  14. ValueCell<bool> readOnly = const ValueCell.value(false),
  15. ValueCell<ToolbarOptions?>? toolbarOptions,
  16. ValueCell<bool?>? showCursor,
  17. ValueCell<bool> autofocus = const ValueCell.value(false),
  18. ValueCell<String> obscuringCharacter = const ValueCell.value('•'),
  19. ValueCell<bool> obscureText = const ValueCell.value(false),
  20. ValueCell<bool> autocorrect = const ValueCell.value(true),
  21. ValueCell<SmartDashesType?>? smartDashesType,
  22. ValueCell<SmartQuotesType?>? smartQuotesType,
  23. ValueCell<bool> enableSuggestions = const ValueCell.value(true),
  24. ValueCell<int?> maxLines = const ValueCell.value(1),
  25. ValueCell<int?>? minLines,
  26. ValueCell<bool> expands = const ValueCell.value(false),
  27. ValueCell<int?>? maxLength,
  28. ValueCell<MaxLengthEnforcement?>? maxLengthEnforcement,
  29. ValueCell<void Function()?>? onEditingComplete,
  30. ValueCell<void Function(String)?>? onSubmitted,
  31. ValueCell<void Function(String, Map<String, dynamic>)?>? onAppPrivateCommand,
  32. ValueCell<List<TextInputFormatter>?>? inputFormatters,
  33. ValueCell<bool?>? enabled,
  34. ValueCell<double> cursorWidth = const ValueCell.value(2.0),
  35. ValueCell<double?>? cursorHeight,
  36. ValueCell<Radius?>? cursorRadius,
  37. ValueCell<bool?>? cursorOpacityAnimates,
  38. ValueCell<Color?>? cursorColor,
  39. ValueCell<BoxHeightStyle> selectionHeightStyle = const ValueCell.value(BoxHeightStyle.tight),
  40. ValueCell<BoxWidthStyle> selectionWidthStyle = const ValueCell.value(BoxWidthStyle.tight),
  41. ValueCell<Brightness?>? keyboardAppearance,
  42. ValueCell<EdgeInsets> scrollPadding = const ValueCell.value(EdgeInsets.all(20.0)),
  43. ValueCell<DragStartBehavior> dragStartBehavior = const ValueCell.value(DragStartBehavior.start),
  44. ValueCell<bool?>? enableInteractiveSelection,
  45. ValueCell<TextSelectionControls?>? selectionControls,
  46. ValueCell<void Function()?>? onTap,
  47. ValueCell<void Function(PointerDownEvent)?>? onTapOutside,
  48. ValueCell<MouseCursor?>? mouseCursor,
  49. ValueCell<InputCounterWidgetBuilder?>? buildCounter,
  50. ValueCell<ScrollPhysics?>? scrollPhysics,
  51. ValueCell<Iterable<String>?> autofillHints = const ValueCell.value(<String>[]),
  52. ValueCell<ContentInsertionConfiguration?>? contentInsertionConfiguration,
  53. ValueCell<Clip> clipBehavior = const ValueCell.value(Clip.hardEdge),
  54. ValueCell<String?>? restorationId,
  55. ValueCell<bool> scribbleEnabled = const ValueCell.value(true),
  56. ValueCell<bool> enableIMEPersonalizedLearning = const ValueCell.value(true),
  57. ValueCell<bool> canRequestFocus = const ValueCell.value(true),
  58. ValueCell<SpellCheckConfiguration?>? spellCheckConfiguration,
  59. ValueCell<TextMagnifierConfiguration?>? magnifierConfiguration,
})

Create a CellTextField.

The only required parameter is content which is a MutableCell to which the content of the text field is bound. Whenever the cell's value changes the content is updated to reflect the cell value, and similarly when the content of the text field is changed, the cell's value is updated to reflect content.

The text selection is bound to the cell selection if it is given. This means when the selection is changed by the user, the value of selection is updated to reflect the selection. When the value of selection is changed, the selection in the text field is updated to reflect the value of selection.

The remaining parameters are the same as in the constructor of TextField.

Implementation

const CellTextField({
  super.key,
  required this.content,
  this.selection,
  this.focusNode,
  this.decoration = const ValueCell.value(InputDecoration()),
  this.keyboardType,
  this.textInputAction,
  this.textCapitalization = const ValueCell.value(TextCapitalization.none),
  this.style,
  this.strutStyle,
  this.textAlign = const ValueCell.value(TextAlign.start),
  this.textAlignVertical,
  this.textDirection,
  this.readOnly = const ValueCell.value(false),
  this.toolbarOptions,
  this.showCursor,
  this.autofocus = const ValueCell.value(false),
  this.obscuringCharacter = const ValueCell.value('•'),
  this.obscureText = const ValueCell.value(false),
  this.autocorrect = const ValueCell.value(true),
  this.smartDashesType,
  this.smartQuotesType,
  this.enableSuggestions = const ValueCell.value(true),
  this.maxLines = const ValueCell.value(1),
  this.minLines,
  this.expands = const ValueCell.value(false),
  this.maxLength,
  this.maxLengthEnforcement,
  this.onEditingComplete,
  this.onSubmitted,
  this.onAppPrivateCommand,
  this.inputFormatters,
  this.enabled,
  this.cursorWidth = const ValueCell.value(2.0),
  this.cursorHeight,
  this.cursorRadius,
  this.cursorOpacityAnimates,
  this.cursorColor,
  this.selectionHeightStyle = const ValueCell.value(BoxHeightStyle.tight),
  this.selectionWidthStyle = const ValueCell.value(BoxWidthStyle.tight),
  this.keyboardAppearance,
  this.scrollPadding = const ValueCell.value(EdgeInsets.all(20.0)),
  this.dragStartBehavior = const ValueCell.value(DragStartBehavior.start),
  this.enableInteractiveSelection,
  this.selectionControls,
  this.onTap,
  this.onTapOutside,
  this.mouseCursor,
  this.buildCounter,
  this.scrollPhysics,
  this.autofillHints = const ValueCell.value(<String>[]),
  this.contentInsertionConfiguration,
  this.clipBehavior = const ValueCell.value(Clip.hardEdge),
  this.restorationId,
  this.scribbleEnabled = const ValueCell.value(true),
  this.enableIMEPersonalizedLearning = const ValueCell.value(true),
  this.canRequestFocus = const ValueCell.value(true),
  this.spellCheckConfiguration,
  this.magnifierConfiguration,
});