ElementQuery class abstract
A query object of a collection of Element.
- Inheritance
- Available Extensions
Constructors
-
ElementQuery(List<
Element> elements) -
factory
Properties
- context → dynamic
-
The DOM node context originally passed to Query; if none was passed
no setterinherited
- data → Data
-
The interface to access custom element data.
no setterinherited
- first ↔ Element
-
The first element.
getter/setter pairinherited
- firstIfAny → Element?
-
Return the first matched element, or null if empty.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int?
-
Retrieve the height of the first element of this collection.
no setterinherited
- html ↔ String?
-
Get the inner HTML contents of the first element.
getter/setter pair
- isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
Element> -
A new
Iterator
that allows iterating the elements of thisIterable
.no setterinherited - last ↔ Element
-
The last element.
getter/setter pairinherited
- length ↔ int
-
The number of objects in this list.
getter/setter pairinherited
-
offset
↔ Point<
num> ? -
Get the current coordinates of the first element, relative to the document.
getter/setter pair
- offsetLeft ← int
-
Set the x coordinate of every element in this collection, relative to the
no getter
- offsetParent → ElementQuery
-
Get the closest ancestor element that is positioned.
no setter
- offsetTop ← int
-
Set the y coordinate of every element in this collection, relative to the
no getter
-
position
→ Point<
num> ? -
Get the current coordinates of the first element in the set of matched
no setter
-
reversed
→ Iterable<
Element> -
An Iterable of the objects in this list in reverse order.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollLeft ↔ int?
-
Get the current horizontal position of the scroll bar for the first element
getter/setter pairinherited
- scrollTop ↔ int?
-
Get the current vertical position of the scroll bar for the first element
getter/setter pairinherited
- selector → String?
-
no setterinherited
- single → Element
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
- text ↔ String
-
Get the combined text contents over all elements in this collection.
getter/setter pair
- width → int?
-
Retrieve the width of the first element of this collection.
no setterinherited
Methods
-
add(
Element value) → void -
Adds
value
to the end of this list, extending the length by one.inherited -
addAll(
Iterable< Element> iterable) → void -
Appends all objects of
iterable
to the end of this list.inherited -
addClass(
String name) → void -
Add the CSS class of given
name
to all the elements in this collection. -
after(
dynamic content) → void -
Insert
content
after each element in this collection. -
any(
bool test(Element element)) → bool -
Checks whether any element of this iterable satisfies
test
.inherited -
append(
dynamic content) → void -
Insert
content
to the end of each element in this collection. -
appendTo(
dynamic target) → void -
Insert every element in this collection to the end of the
target
. -
asMap(
) → Map< int, Element> -
An unmodifiable Map view of this list.
inherited
-
before(
dynamic content) → void -
Insert
content
before each element in this collection. -
cast<
R> () → List< R> -
Returns a view of this list as a list of
R
instances.inherited -
change(
[QueryEventListener handler]) → void - Bind an event handler to the "change" event, or trigger that event
-
children(
[String selector]) → ElementQuery - Retrieve the union of childrens of each element in this collection.
-
clear(
) → void -
Removes all objects from this list; the length of the list becomes zero.
inherited
-
click(
[QueryEventListener handler]) → void - Bind an event handler to the "click" event, or trigger that event
-
clone(
[bool withDataAndEvents, bool deepWithDataAndEvents]) → ElementQuery - Create a deep copy of the elements in this collection. *
-
closest(
String selector) → ElementQuery - Retrieve the closest ancestor (including itself) of each element in this
-
contains(
Object? element) → bool -
Whether the collection contains an element equal to
element
.inherited -
css(
String name, [String value]) → dynamic -
Get the style property value of the given
name
on the first element -
detach(
{String selector, bool data = true}) → void - Remove the elements from the DOM. *
-
elementAt(
int index) → Element -
Returns the
index
th element.inherited -
empty(
) → void - Remove all child nodes of the elements in this collection from the DOM.
-
end(
) → Query -
Pops out the top Query object in the stack and retrieve the previous one.
inherited
-
every(
bool test(Element element)) → bool -
Checks whether every element of this iterable satisfies
test
.inherited -
expand<
T> (Iterable< T> toElements(Element element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
fillRange(
int start, int end, [Element? fillValue]) → void -
Overwrites a range of elements with
fillValue
.inherited -
find(
String selector) → ElementQuery -
Retrieve an ElementQuery containing descendants of this element collection
inherited
-
firstWhere(
bool test(Element element), {Element orElse()?}) → Element -
The first element that satisfies the given predicate
test
.inherited -
fold<
T> (T initialValue, T combine(T previousValue, Element element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
Iterable< Element> other) → Iterable<Element> -
Creates the lazy concatenation of this iterable and
other
.inherited -
forEach(
void action(Element element)) → void -
Invokes
action
on each element of this iterable in iteration order.inherited -
getRange(
int start, int end) → Iterable< Element> -
Creates an Iterable that iterates over a range of elements.
inherited
-
hasClass(
String name) → bool -
Return true if any of the element contains the given
name
in its CSS -
hide(
) → void - Hide all the elements in this collection by setting their CSS disaply
-
indexOf(
Element element, [int start = 0]) → int -
The first index of
element
in this list.inherited -
indexWhere(
bool test(Element element), [int start = 0]) → int -
The first index in the list that satisfies the provided
test
.inherited -
insert(
int index, Element element) → void -
Inserts
element
at positionindex
in this list.inherited -
insertAll(
int index, Iterable< Element> iterable) → void -
Inserts all objects of
iterable
at positionindex
in this list.inherited -
join(
[String separator = ""]) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastIndexOf(
Element element, [int? start]) → int -
The last index of
element
in this list.inherited -
lastIndexWhere(
bool test(Element element), [int? start]) → int -
The last index in the list that satisfies the provided
test
.inherited -
lastWhere(
bool test(Element element), {Element orElse()?}) → Element -
The last element that satisfies the given predicate
test
.inherited -
map<
T> (T toElement(Element 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
-
off(
String types, {String? selector, QueryEventListener? handler}) → void -
Unregister a
handler
for events of given types.inherited -
on(
String types, QueryEventListener handler, {String? selector}) → void -
Register a
handler
for events of giventypes
on selected elements.inherited -
one(
String types, QueryEventListener handler, {String? selector}) → void -
Register a one-time
handler
for events of giventypes
. Once called,inherited -
parent(
[String selector]) → ElementQuery - Retrieve the parents of each element in this collection.
-
prepend(
dynamic content) → void -
Insert
content
to the beginning of each element in this collection. -
prependTo(
dynamic target) → void -
Insert every element in this collection to the beginning of the
target
. -
pushStack(
List< Element> elems) → ElementQuery -
Add a collection of DOM elements onto the Query stack.
inherited
-
reduce(
Element combine(Element value, Element element)) → Element -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
reflow(
) → void - Force the browser to reflow the given element to apply the latest
-
remove(
Object? value) → bool -
Removes the first occurrence of
value
from this list.inherited -
removeAt(
int index) → Element -
Removes the object at position
index
from this list.inherited -
removeClass(
String name) → void -
Remove the CSS class of given
name
from all the elements in this collection. -
removeLast(
) → Element -
Removes and returns the last object in this list.
inherited
-
removeRange(
int start, int end) → void -
Removes a range of elements from the list.
inherited
-
removeWhere(
bool test(Element element)) → void -
Removes all objects from this list that satisfy
test
.inherited -
replaceRange(
int start, int end, Iterable< Element> replacements) → void -
Replaces a range of elements with the elements of
replacements
.inherited -
retainWhere(
bool test(Element element)) → void -
Removes all objects from this list that fail to satisfy
test
.inherited -
setAll(
int index, Iterable< Element> iterable) → void -
Overwrites elements with the objects of
iterable
.inherited -
setRange(
int start, int end, Iterable< Element> iterable, [int skipCount = 0]) → void -
Writes some elements of
iterable
into a range of this list.inherited -
show(
) → void - Show all the elements in this collection by changing their CSS display
-
shuffle(
[Random? random]) → void -
Shuffles the elements of this list randomly.
inherited
-
singleWhere(
bool test(Element element), {Element orElse()?}) → Element -
The single element that satisfies
test
.inherited -
skip(
int count) → Iterable< Element> -
Creates an Iterable that provides all but the first
count
elements.inherited -
skipWhile(
bool test(Element value)) → Iterable< Element> -
Creates an
Iterable
that skips leading elements whiletest
is satisfied.inherited -
sort(
[int compare(Element a, Element b)?]) → void -
Sorts this list according to the order specified by the
compare
function.inherited -
sublist(
int start, [int? end]) → List< Element> -
Returns a new list containing the elements between
start
andend
.inherited -
take(
int count) → Iterable< Element> -
Creates a lazy iterable of the
count
first elements of this iterable.inherited -
takeWhile(
bool test(Element value)) → Iterable< Element> -
Creates a lazy iterable of the leading elements satisfying
test
.inherited -
toggle(
[bool state]) → void - Toggle the visibility of all the elements in this collection by altering
-
toggleClass(
String name) → void -
Toggle the CSS class of given
name
in all the elements in this collection. -
toList(
{bool growable = true}) → List< Element> -
Creates a List containing the elements of this Iterable.
inherited
-
toSet(
) → Set< Element> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
trigger(
String type, {dynamic data}) → void -
Trigger an event of given
type
on all matched elements, with giveninherited -
triggerEvent(
QueryEvent event) → void -
Trigger the given
event
on all matched elements, with given data ifinherited -
triggerHandler(
String type, {dynamic data}) → void -
Trigger an event of given
type
on the first (if any) matched element,inherited -
where(
bool test(Element element)) → Iterable< Element> -
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 +(
List< Element> other) → List<Element> -
Returns the concatenation of this list and
other
.inherited -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int index) → Element -
The object at the given
index
in the list.inherited -
operator []=(
int index, Element value) → void -
Sets the value at the given
index
in the list tovalue
.inherited