EasyTextList class final
A specialized linked list implementation for managing EasyText elements with optimized text manipulation and caching capabilities.
Usage Example:
final textList = EasyTextList();
textList.add(EasyText('Hello'));
textList.add(EasyText(' World'));
print(textList.text); // Output: 'Hello World'
- Inheritance
-
- Object
- Iterable<
EasyText> - LinkedList<
EasyText> - EasyTextList
Constructors
- EasyTextList()
- EasyTextList.easy(EasyText text)
- Create a list with a single EasyText
-
EasyTextList.from(Iterable<
EasyText> iterable) - EasyTextList.fromDelta(Delta delta)
- Create an EasyTextList from a Delta representation
-
EasyTextList.fromJsonList(Iterable<
Map< elements)String, dynamic> > - EasyTextList.fromStr(String text, [EasyAttributeStyles? styles])
-
Create a list with a single EasyText
containing the
textandstylespassed
Properties
- first → EasyText
-
The first element.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
EasyText> -
A new
Iteratorthat allows iterating the elements of thisIterable.no setterinherited - last → EasyText
-
The last element.
no setterinherited
- lastIndex ↔ int?
-
Gets the index of the last accessed element, if any.
getter/setter pair
- lastUsed ↔ EasyText?
-
Gets the last accessed EasyText element, if any.
getter/setter pair
- length → int
-
The number of elements in this Iterable.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → EasyText
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
- textLength → int
-
Returns the length of all EasyText elements in this list
no setter
Methods
-
add(
EasyText entry) → void -
Adds an EasyText entry to the end of the list and updates the text cache.
override
-
addAll(
Iterable< EasyText> entries) → void -
Adds
entriesto the end of the linked list.inherited -
addFirst(
EasyText entry) → void -
Adds
entryto the beginning of the linked list.inherited -
any(
bool test(EasyText element)) → bool -
Checks whether any element of this iterable satisfies
test.inherited -
cast<
R> () → Iterable< R> -
A view of this iterable as an iterable of
Rinstances.inherited -
clear(
) → void -
Remove all elements from this linked list.
inherited
-
contains(
Object? entry) → bool -
Whether
entryis a LinkedListEntry belonging to this list.inherited -
elementAt(
int index) → EasyText -
Returns the EasyText element at the specified
indexwith optimization for consecutive access to the same index.override -
every(
bool test(EasyText element)) → bool -
Checks whether every element of this iterable satisfies
test.inherited -
expand<
T> (Iterable< T> toElements(EasyText element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
firstWhere(
bool test(EasyText element), {EasyText orElse()?}) → EasyText -
The first element that satisfies the given predicate
test.inherited -
fold<
T> (T initialValue, T combine(T previousValue, EasyText element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
Iterable< EasyText> other) → Iterable<EasyText> -
Creates the lazy concatenation of this iterable and
other.inherited -
forEach(
void action(EasyText entry)) → void -
Call
actionwith each entry in this linked list.inherited -
join(
[String separator = ""]) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastWhere(
bool test(EasyText element), {EasyText orElse()?}) → EasyText -
The last element that satisfies the given predicate
test.inherited -
map<
T> (T toElement(EasyText e)) → Iterable< T> -
The current elements of this iterable modified by
toElement.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query(
int start, int length) → EasyTextList -
Get a sublist of texts starting from
startindex with the givenlength. -
reduce(
EasyText combine(EasyText value, EasyText element)) → EasyText -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
remove(
EasyText entry) → bool -
Removes
entryfrom the linked list.inherited -
singleWhere(
bool test(EasyText element), {EasyText orElse()?}) → EasyText -
The single element that satisfies
test.inherited -
skip(
int count) → Iterable< EasyText> -
Creates an Iterable that provides all but the first
countelements.inherited -
skipWhile(
bool test(EasyText value)) → Iterable< EasyText> -
Creates an
Iterablethat skips leading elements whiletestis satisfied.inherited -
take(
int count) → Iterable< EasyText> -
Creates a lazy iterable of the
countfirst elements of this iterable.inherited -
takeWhile(
bool test(EasyText value)) → Iterable< EasyText> -
Creates a lazy iterable of the leading elements satisfying
test.inherited -
toDelta(
) → Delta - Return a Delta representation of the EasyTextList
-
toJson(
) → Map< String, dynamic> -
toList(
{bool growable = true}) → List< EasyText> -
Creates a List containing the elements of this Iterable.
inherited
-
toPlainText(
) → String - Generates a plain text string by concatenating the text of all EasyText elements in the list.
-
toSet(
) → Set< EasyText> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
Returns a string representation of (some of) the elements of
this.inherited -
where(
bool test(EasyText element)) → Iterable< EasyText> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test.inherited -
whereType<
T> () → Iterable< T> -
Creates a new lazy Iterable with all elements that have type
T.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited