HtmlEditorController class
The controller for the HTML editor.
It's usage is similar to that of other controllers in Flutter.
Don't foget to call dispose()
when you're done with it to avoid memory leaks.
initialHtml
is the initial value provided to the editor.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
HtmlEditorValue> - HtmlEditorController
Constructors
- HtmlEditorController({bool processInputHtml = true, bool processNewLineAsBr = false, bool processOutputHtml = true, String? initialHtml})
Properties
- characterCount → int
-
Getter which returns the count of the human readable characters.
no setter
- clonedValue → HtmlEditorValue
-
Clone the current value to another instance.
no setter
-
events
→ Stream<
EditorEvent> -
Stream used to send events to the editor.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- html ↔ String
-
The HTML value of the editor.
getter/setter pair
- processedHtml → String
-
Get the processed html value of the editor.
no setter
- processInputHtml → bool
-
Determines whether text processing should happen on input HTML,
e.g. whether a new line should be converted to a
.final - processNewLineAsBr → bool
-
Determines whether newlines (\n) should be written as
. This is not recommended for HTML documents.final - processOutputHtml → bool
-
Determines whether text processing should happen on output HTML, e.g.
whether
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionState ↔ EditorSelectionState
-
The state of the selected text from the editor.
getter/setter pair
- value ↔ HtmlEditorValue
-
The current value stored in this notifier.
getter/setter pairinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clear(
) → void - Clear the editor content and remove all stored history.
-
clearFocus(
) → void - Clear the focus from the editor field.
-
createLink(
{required String text, required String url, bool isNewWindow = true}) → void - Create/insert a link in the editor.
-
disable(
) → void - Disable the editor field.
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
enable(
) → void - Enable the editor field.
-
insertNetworkImage(
{required String url, String filename = ""}) → void - Insert a network image at the position of the cursor in the editor.
-
insertText(
{required String text}) → void - Insert text at the end of the current HTML content in the editor.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
pasteHtml(
{required String html}) → void - Paste html code into the editor.
-
redo(
) → void - Redo the last action.
-
reload(
) → void - Reloads the editor.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
requestFocus(
) → void - Request focus for the editor field.
-
sendEvent(
EditorEvent event) → void - Send an event to the editor.
-
setCursorToEnd(
) → void - Move the cursor at the end of the current content.
-
toggleCodeView(
) → void - Toggle between the code view and the rich text view.
-
toString(
) → String -
A string representation of this object.
inherited
-
undo(
) → void - Undo the last action.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
processHtml(
{required String html, bool processInputHtml = true, bool processNewLineAsBr = false}) → String - Helper function to process input html