PackagedHtmlEditor class

A combination of controls and editor for a simpler usage.

Like for the editor you can either use the onCreated(EditorApi) callback or a global key to get access to the state, in this case the PackagedHtmlEditorState. With either the state or the HtmlEditorApi you can access the edited text with

String edited = await editorApi.getText();

Alternatively call editorApi.getFullHtml() to retrieve a full HTML document.

Inheritance

Constructors

PackagedHtmlEditor({Key? key, String initialContent = '', bool adjustHeight = true, int minHeight = 100, void onCreated(HtmlEditorApi)?, bool splitBlockquotes = true, bool excludeDocumentLevelControls = false})
Creates a new packaged HTML editor
const

Properties

adjustHeight bool
Set adjustHeight to let the editor set its height automatically
final
excludeDocumentLevelControls bool
Set excludeDocumentLevelControls to true in case document level controls such as the page background color should be excluded.
final
hashCode int
The hash code for this object.
no setterinherited
initialContent String
The initial input text
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
minHeight int
Specify the minHeight to set a different height than the default 100 pixel.
final
onCreated → (void Function(HtmlEditorApi)?)
Define the onCreated(EditorApi) callback to get notified when the API is ready and to retrieve the end result.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
splitBlockquotes bool
Defines if blockquotes should be split when the user adds a new line
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() PackagedHtmlEditorState
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
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}) 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

Operators

operator ==(Object other) bool
The equality operator.
inherited