RichTextEditorController class

This is the main controller for the text editor

Inheritance

Constructors

RichTextEditorController({String? text, TextDeltas? deltas, TextMetadata? metadata})
Constructs an instance of RichTextEditorController with the provided text and deltas
RichTextEditorController.fromMap(Map<String, dynamic> map)
Data deserializer method for this class
factory

Properties

deltas TextDeltas
This holds all the text changes per character and it's corresponding style/metadata
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
indexOflListChar int?
getter/setter pairinherited
isListMode bool
no setterinherited
metadata TextMetadata?
getter/setter pairinherited
metadataToggled bool
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selection TextSelection
The currently selected text.
getter/setter pairinherited
text String
The current string the user is editing.
getter/setter pairinherited
value TextEditingValue
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
applyDefaultMetadataChange(TextMetadata changedMetadata) → void
inherited
applyMetadataToTextInSelection({required TextMetadata newMetadata, required TextDeltas deltas, required TextMetadataChange change, required TextSelection selection}) TextDeltas
Applies the newMetadata to the deltas in the selection by the change.
inherited
buildTextSpan({required BuildContext context, TextStyle? style, required bool withComposing}) TextSpan
Builds TextSpan from current editing value.
inherited
changeAlignment(TextAlign alignment) → void
Changes the TextMetadata.alignment to the given alignment.
inherited
changeColor(Color color) → void
inherited
changeFontSize(double fontSize) → void
inherited
changeStyleOnSelectionChange({TextMetadata? changedMetadata, required TextMetadataChange change, required TextDeltas modifiedDeltas, required TextSelection selection}) → void
inherited
clear() → void
Set the value to empty.
inherited
clearComposing() → void
Set the composing region to an empty range.
inherited
copy() RichTextEditorController
returns a copy of this controller
copyWith({TextDeltas? deltas, TextEditingValue? value, TextMetadata? metadata}) → _RichTextEditorController
returns a copy of this controller with the given parameters
inherited
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).
inherited
isSelectionWithinTextBounds(TextSelection selection) bool
Check that the selection is inside of the bounds of text.
inherited
modifyDeltasForBulletListChange(List<TextDelta> modifiedDeltas, List<TextDelta> oldDeltas) List<TextDelta>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
resetMetadataOnSelectionCollapsed() → void
If a selection changed and is inside the text and empty (collapsed), this function sets the current metadata to the metadata of the text before it's new position
inherited
setDeltas(TextDeltas newDeltas) → void
set the new deltas and reset metadata relative to the new selection/caret position
inherited
textBeforeSelection() String?
inherited
toggleBold() → void
Toggles the TextMetadata.fontWeight between FontWeight.normal and FontWeight.w700.
inherited
toggleItalic() → void
Toggles the TextMetadata.fontStyle between FontStyle.normal and FontStyle.italic.
inherited
toggleListMode() → void
inherited
toggleSubscript() → void
Toggles the TextMetadata.fontFeatures between empty list and FontFeature.subscripts().
inherited
toggleSuperscript() → void
Toggles the TextMetadata.decoration between TextDecorationEnum.none and TextDecorationEnum.lineThrough.
inherited
toggleUnderline() → void
Toggles the TextMetadata.decoration between TextDecorationEnum.none and TextDecorationEnum.underline.
inherited
toMap() Map<String, dynamic>
Data serializer method for this class
toString() String
A string representation of this object.
inherited

Operators

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

Constants

defaultMetadata → const TextMetadata