CodeEditor constructor

CodeEditor({
  1. String? label,
  2. String? name,
  3. TextEditingController? controller,
  4. Object? value,
  5. String? placeholder,
  6. bool required = false,
  7. bool disabled = false,
  8. bool readonly = false,
  9. bool showLineNumbers = true,
  10. Object height = 320,
  11. InputVariant variant = InputVariant.outline,
  12. ComponentSize size = ComponentSize.md,
  13. String? error,
  14. FormErrors? errors,
  15. String? helpText,
  16. String? className,
  17. Map<String, Object?> props = const {},
  18. Map<String, Object?> editorProps = const {},
  19. Map<String, Object?> style = const {},
  20. Map<String, Object?> editorStyle = const {},
  21. DartStyle? dartStyle,
  22. DartStyle? editorDartStyle,
  23. void onChanged(
    1. String value
    )?,
})

Creates a plain-text code editor.

Implementation

CodeEditor({
  String? label,
  String? name,
  TextEditingController? controller,
  Object? value,
  String? placeholder,
  bool required = false,
  bool disabled = false,
  bool readonly = false,
  bool showLineNumbers = true,
  Object height = 320,
  InputVariant variant = InputVariant.outline,
  ComponentSize size = ComponentSize.md,
  String? error,
  FormErrors? errors,
  String? helpText,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> editorProps = const {},
  Map<String, Object?> style = const {},
  Map<String, Object?> editorStyle = const {},
  DartStyle? dartStyle,
  DartStyle? editorDartStyle,
  void Function(String value)? onChanged,
}) : super(
        'div',
        props: fieldWrapperProps(
          props: props,
          className: className,
          dartStyle: dartStyle,
          style: style,
        ),
        children: _children(
          label: label,
          name: name,
          controller: controller,
          value: controller?.text ?? value,
          placeholder: placeholder,
          required: required,
          disabled: disabled,
          readonly: readonly,
          showLineNumbers: showLineNumbers,
          height: height,
          variant: variant,
          size: size,
          error: resolveFieldError(name: name, error: error, errors: errors),
          helpText: helpText,
          editorProps: editorProps,
          editorStyle: editorStyle,
          editorDartStyle: editorDartStyle,
          onChanged: onChanged,
        ),
      );