RTFTextFieldController class
This is the main controller for the text editor
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
TextEditingValue> - TextEditingController
- RTFTextFieldController
Constructors
- RTFTextFieldController({String? text, TextDeltas? deltas, TextMetadata? metadata})
-
Constructs an instance of RTFTextFieldController with the provided
text
anddeltas
-
RTFTextFieldController.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 range within 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 thedeltas
in theselection
by thechange
.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 givenalignment
.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
-
compareNewStringAndOldTextDeltasForChanges(
String text, TextDeltas oldDeltas) → TextDeltas -
inherited
-
copy(
) → RTFTextFieldController - 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
-
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 -
inherited
-
setDeltas(
TextDeltas newDeltas) → void -
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
betweenTextDecorationEnum.none
andTextDecorationEnum.lineThrough
.inherited -
toggleUnderline(
) → void -
Toggles the
TextMetadata.decoration
betweenTextDecorationEnum.none
andTextDecorationEnum.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