CodeEditor constructor
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 onChanged(
- 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,
),
);