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 EditorApi
you can access the edited text with
String edited = await editorApi.getText();
Alternatively call editorApi.getFullHtml()
to retrieve a full HTML document.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PackagedHtmlEditor
Constructors
-
PackagedHtmlEditor({Key? key, String initialContent = '', bool adjustHeight = true, int minHeight = 100, void onCreated(HtmlEditorApi)?, bool splitBlockquotes = true, bool addDefaultSelectionMenuItems = true, List<
TextSelectionMenuItem> ? textSelectionMenuItems}) - Creates a new packaged HTML editor
Properties
- addDefaultSelectionMenuItems β bool
-
Defines if the default text selection menu items
π
(bold),π°
(italic),UΜ²
(underlined),TΜΆ
(strikethrough) should be added - defaults totrue
.final - adjustHeight β bool
-
Set adjustHeight to let the editor set its height automatically - by default this is
true
.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 - defaults to
true
.final -
textSelectionMenuItems
β List<
TextSelectionMenuItem> ? -
List of custom text selection / context menu items.
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