HtmlEditorApi class
API to control the HtmlEditor
.
Get access to this API either by waiting for the HtmlEditor.onCreated()
callback or by accessing
the HtmlEditorState
with a GlobalKey<HtmlEditorState>
.
Constructors
- HtmlEditorApi(HtmlEditorState _htmlEditorState)
Properties
- customStyles ← String
-
Define any custom CSS styles, ammending the default styles
no getter
- hashCode → int
-
The hash code for this object.
no setterinherited
- onAlignSettingsChanged ↔ (void Function(ElementAlign)?)
-
Callback to be informed when the align settings have been changed
getter/setter pair
- onColorChanged ↔ (void Function(ColorSetting)?)
-
Callback to be informed when the color settings have been changed
getter/setter pair
- onFormatSettingsChanged ↔ (void Function(FormatSettings)?)
-
Callback to be informed when the format settings have been changed
getter/setter pair
- onReady ↔ (void Function()?)
-
Callback to be informed when the API can be used fully.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- styles ← String
-
Define any custom CSS styles, replacing the existing styles.
no getter
- webViewController ← InAppWebViewController
-
no getter
Methods
-
formatAlignCenter(
) → Future - Formats the current paragraph to center
-
formatAlignJustify(
) → Future - Formats the current paragraph to justify
-
formatAlignLeft(
) → Future - Formats the current paragraph to align left
-
formatAlignRight(
) → Future - Formats the current paragraph to align right
-
formatBold(
) → Future - Formats the current text to be bold
-
formatItalic(
) → Future - Formats the current text to be italic
-
formatStrikeThrough(
) → Future - Formats the current text to be striked through
-
formatUnderline(
) → Future - Formats the current text to be underlined
-
getFullHtml(
{String? content}) → Future< String> - Retrieves the edited text within a complete HTML document.
-
getSelectedText(
) → Future< String?> - Retrieves the currently selected text.
-
getText(
) → Future< String> - Retrieves the edited text as HTML
-
insertHtml(
String html) → Future -
Inserts the
html
code at the insertion point (deletes selection). -
insertImageData(
Uint8List data, String mimeType, {int? maxWidth}) → Future -
Inserts the given image
data
with the specifidmimeType
into the editor. -
insertImageFile(
File file, String mimeType, {int? maxWidth}) → Future -
Converts the given
file
with the specifidmimeType
into image data and inserts it into the editor. -
insertOrderedList(
) → Future - Inserts an ordered list at the current position
-
insertText(
String text) → Future -
Inserts the given plain
text
at the insertion point (deletes selection). -
insertUnorderedList(
) → Future - Inserts an unordered list at the current position
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setBackgroundColor(
Color color, {double opacity = 1.0}) → Future -
Sets the given
color
as the current text background color. -
setForegroundColor(
Color color, {double opacity = 1.0}) → Future -
Sets the given
color
as the current foreground / text color. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited