RichTextEditor class
A rich text WYSIWYG editor with formatting toolbar and controller support.
- Inheritance
-
- Object
- FlintNode
- FlintComponent
- StatefulComponent
- RichTextEditor
Constructors
-
RichTextEditor({String? label, String? name, TextEditingController? controller, String? initialHtml, String placeholder = 'Write something...', bool required = false, bool disabled = false, 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, String height = '300px', Future<String> onUploadImage(File file)?, void onChanged(String html)?, List<RichTextToolbarItem> toolbarItems = const [RichTextToolbarItem.bold, RichTextToolbarItem.italic, RichTextToolbarItem.underline, RichTextToolbarItem.strikeThrough, RichTextToolbarItem.divider, RichTextToolbarItem.heading1, RichTextToolbarItem.heading2, RichTextToolbarItem.paragraph, RichTextToolbarItem.divider, RichTextToolbarItem.bulletList, RichTextToolbarItem.orderedList, RichTextToolbarItem.blockquote, RichTextToolbarItem.codeBlock, RichTextToolbarItem.divider, RichTextToolbarItem.link, RichTextToolbarItem.image, RichTextToolbarItem.removeFormat]}) - Creates a rich text editor.
Properties
- className ↔ String?
-
Optional class name for the wrapper element.
getter/setter pair
- controller ↔ TextEditingController?
-
Synchronized text editing controller.
getter/setter pair
- dartStyle ↔ DartStyle?
-
Typed style for the wrapper element.
getter/setter pair
- disabled ↔ bool
-
Whether editing is disabled.
getter/setter pair
- editorDartStyle ↔ DartStyle?
-
Typed style for the contenteditable element.
getter/setter pair
-
editorProps
↔ Map<
String, Object?> -
Extra HTML properties for the contenteditable element.
getter/setter pair
-
editorStyle
↔ Map<
String, Object?> -
Extra CSS style for the contenteditable element.
getter/setter pair
- error ↔ String?
-
Explicit validation error.
getter/setter pair
- errors ↔ FormErrors?
-
Form validation error collection.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → String
-
Editor element height (e.g. '300px').
final
- helpText ↔ String?
-
Helpful message text shown below editor.
getter/setter pair
- initialHtml → String?
-
Initial HTML content if controller is not provided.
final
- name → String?
-
Optional field identifier.
final
- onChanged ↔ void Function(String html)?
-
Optional content change callback.
getter/setter pair
-
onUploadImage
→ Future<
String> Function(File file)? -
Optional custom image upload handler.
final
- placeholder ↔ String
-
Input placeholder when empty.
getter/setter pair
- preserveState → bool
-
Whether Flint should preserve this component instance across parent
rerenders when the runtime type and tree position match.
no setterinherited
-
props
↔ Map<
String, Object?> -
Extra HTML properties for the wrapper element.
getter/setter pair
- required ↔ bool
-
Whether this field is required.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
style
↔ Map<
String, Object?> -
Extra CSS style for the wrapper element.
getter/setter pair
-
toolbarItems
→ List<
RichTextToolbarItem> -
Toolbar configuration list.
final
Methods
-
attach(
void scheduleRender()) → void -
Attaches the render scheduler used by setState.
inherited
-
build(
) → View? -
Builds this component's renderable output.
override
-
didMount(
) → void -
Called after the component is first mounted in the browser.
inherited
-
didUpdate(
) → void -
Called after the component updates following a rerender.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setState(
FlintStateUpdater update) → void -
Applies
updateand schedules this component to render again.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
updateFrom(
covariant RichTextEditor next) → void -
Receives the next component instance when Flint preserves this instance.
override
-
willUnmount(
) → void -
Called before the component is removed from the tree.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited