EasyText class final
Represents a contiguous segment of text with consistent styling attributes.
- Inheritance
-
- Object
- LinkedListEntry<
EasyText> - EasyText
Constructors
- EasyText({String? id, required Characters text, EasyAttributeStyles? styles})
- Creates an EasyText instance with the specified text and styles.
- EasyText.empty({String? id})
- Creates an empty EasyText instance with no content and empty styles.
-
EasyText.fromJson(Map<
String, dynamic> json) -
Creates an EasyText instance from json
factory
- EasyText.fromStr({String? id, required String text, EasyAttributeStyles? styles})
- Creates an EasyText instance from a regular string with specified styles.
Properties
- endOffset → int
-
Gets the ending offset of this fragment within its parent list.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- hasText → bool
-
Indicates whether this text fragment contains any character content.
no setter
- id → String
-
Unique identifier for this text fragment
final
- isBlank → bool
-
Indicates whether this text fragment is fully empty.
no setter
- isFirst → bool
-
Determines if this element is the first one into the list
no setter
- isLast → bool
-
Determines if this element is the last one into the list
no setter
- isLinked → bool
-
Determines if this EasyText instance is currently linked to a parent list.
no setter
- length → int
-
The length of this text fragment in characters.
no setter
-
list
→ LinkedList<
EasyText> ? -
The linked list containing this element.
no setterinherited
- next → EasyText?
-
The successor of this element in its linked list.
no setterinherited
- offset → int
-
Gets the starting offset of this fragment within its parent list.
no setter
- owner → EasyTextList?
-
Returns the EasyTextList owner of this EasyText
no setter
- previous → EasyText?
-
The predecessor of this element in its linked list.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strictHashCode → int
-
The strict hash code version for this EasyText instance
no setter
- styles → EasyAttributeStyles
-
The styling attributes applied to this text fragment
final
- text ↔ Characters
-
The character content of this text fragment
getter/setter pair
Methods
-
after(
int point) → Characters - Returns a substring containing characters after the specified point.
-
applyStyle(
EasyAttributeStyles value) → void - Apply all the styles passed to the current EasyText
-
before(
int point) → Characters - Returns a substring containing characters before the specified point.
-
between(
int start, int end) → Characters - Returns a substring between the specified start and end positions.
-
capitalize(
) → EasyText - Returns a new version of this EasyText element with the first letter capitalized.
-
charAt(
int at) → Characters -
Returns the single-character sequence of the
positionth character. -
copyWith(
{String? id, Characters? text, EasyAttributeStyles? styles}) → EasyText - Creates a copy of this EasyText instance with optional modifications.
-
deepEquals(
Object other) → bool - Whether this element is equals than the other EasyText comparing its text and styles
-
delete(
int index, int len, {bool ignoreMerge = false}) → EasyTextChange -
Deletes
lencharacters starting from the specifiedindex. -
extractAt(
int index, int length) → EasyText -
Extract efficiently starting at
indexwith specifiedlength. -
format(
EasyAttributeStyles style, [bool overrideStylesIfEmpty = false, bool ignoreMerge = false]) → EasyTextChange - Formats this EasyText and optimizes it with adjacent EasyTexts if needed.
-
formatRange(
int index, int len, EasyAttributeStyles? style, {bool overrideStylesIfEmpty = true}) → EasyTextChange? -
Applies formatting to a range of text starting at
indexforlencharacters. -
insert(
int index, String data, [EasyAttributeStyles? style, bool ignoreMerge = false]) → EasyTextChange -
Inserts text at the specified
indexwith optional styling. -
insertAfter(
EasyText entry) → void -
Inserts the given entry after this entry in the linked list.
override
-
insertBefore(
EasyText entry) → void -
Inserts the given entry before this entry in the linked list.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAsLastUsed(
) → void - Overrides the last used EasyText instance
-
split(
Characters pattern) → Iterable< Characters> -
Splits this sequence of characters at each occurrence of
pattern. -
splitAt(
int index) → EasyText? - Splits this EasyText at specified offset
-
str(
) → String - Returns the String associated to the Characters instance
-
strictEquals(
Object other) → bool - Determines if an object is equals than this EasyText instance
-
toDelta(
) → Delta -
Returns the
Deltaequivalent version of this EasyText -
toJson(
) → Map< String, dynamic> -
toLowerCase(
) → Characters -
The characters of the lower-case version of
string. -
toOperation(
) → Operation -
Returns the
Operationequivalent version of this EasyText -
toString(
) → String -
A string representation of this object.
override
-
toUpperCase(
) → Characters -
The characters of the upper-case version of
string. -
tryMerge(
) → void - try to merge this element with adjacents parts if they share the same style.
-
unlink(
) → void -
Unlink the element from its linked list.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override