NiceHtmlEditor class
A WYSIWYG-style rich text editor with formatting toolbar.
Uses plain text with markdown-style formatting markers internally. Emits HTML through onChange. Supports:
- Bold, italic, underline, strikethrough
- Headings (H1, H2, H3)
- Lists (ordered, unordered)
- Links, images, tables, code blocks
- Markdown mode toggle
- @Mentions with suggestions dropdown
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- NiceHtmlEditor
- Available extensions
Constructors
-
NiceHtmlEditor({Key? key, required String value, required ValueChanged<
String> onChange, String? placeholder, double height = 200, List<NiceHtmlEditorCommand> toolbar = _defaultToolbar, bool readOnly = false, bool disabled = false, String? label, String? error, String? helperText, bool required = false, String? mentionTrigger, List<NiceMentionItem> ? mentionSuggestions, ValueChanged<String> ? onMentionSearch}) -
const
Properties
- disabled → bool
-
Whether editor is disabled.
final
- error → String?
-
Validation error text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
Editor height.
final
- helperText → String?
-
Helper text below.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
Optional label above the editor.
final
-
mentionSuggestions
→ List<
NiceMentionItem> ? -
Mention suggestion items.
final
- mentionTrigger → String?
-
Mention trigger character (default '@').
final
-
onChange
→ ValueChanged<
String> -
Called when content changes; emits HTML string.
final
-
onMentionSearch
→ ValueChanged<
String> ? -
Called when mention query text changes.
final
- placeholder → String?
-
Placeholder text.
final
- readOnly → bool
-
Whether editor is read-only.
final
- required → bool
-
Whether the field is required.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
toolbar
→ List<
NiceHtmlEditorCommand> -
Visible toolbar commands.
final
- value → String
-
Current HTML content.
final
Methods
-
asFocusable(
{FocusNode? focusNode, bool autofocus = false}) → Widget -
Available on Widget, provided by the NiceAccessibilityExtension extension
Mark this widget as focusable. -
asSemanticButton(
{String? label, VoidCallback? onTap}) → Widget -
Available on Widget, provided by the NiceAccessibilityExtension extension
Mark this widget as a button for screen readers. -
asSemanticHeading(
String label) → Widget -
Available on Widget, provided by the NiceAccessibilityExtension extension
Mark this widget as a heading for screen readers. -
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< NiceHtmlEditor> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
excludeFromSemantics(
) → Widget -
Available on Widget, provided by the NiceAccessibilityExtension extension
Exclude this widget from the semantic tree. -
mergeSemantics(
) → Widget -
Available on Widget, provided by the NiceAccessibilityExtension extension
Merge semantics of child widgets. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
withSemanticLabel(
String label) → Widget -
Available on Widget, provided by the NiceAccessibilityExtension extension
Add a semantic label to this widget.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited