Cursor class
This interface provides random read-write access to the result set returned by a database query.
Cursor implementations are not required to be synchronized so code using a Cursor from multiple threads should perform its own synchronization when using the Cursor.
See: https://developer.android.com/reference/android/database/Cursor
- Inheritance
- Implementers
Constructors
- Cursor()
Properties
- columnCount → int
-
The total number of columns. [...]
read-only
-
columnNames
→ List<
String> -
The names of all of the columns in the result set in the order in which
they were listed in the result. [...]
read-only
- count → int
-
The number of rows in the cursor. [...]
read-only
- extras → Bundle
-
A bundle of extra values. [...]
read-only
- isAfterLast → bool
-
Returns whether the cursor is pointing to the position after the last row. [...]
read-only
- isBeforeFirst → bool
-
Returns whether the cursor is pointing to the position before the first
row. [...]
read-only
- isClosed → bool
-
Returns
true
if the cursor is closed. [...]read-only - isEmpty → bool
-
Returns
true
if there are no elements in this collection. [...]read-only, override - isFirst → bool
-
Returns whether the cursor is pointing to the first row. [...]
read-only
- isLast → bool
-
Returns whether the cursor is pointing to the last row. [...]
read-only
-
iterator
→ Iterator<
Map< String, dynamic> > -
An iterator over the rows of this cursor. [...]
read-only, override
- length → int
-
Returns the number of elements in this. [...]
read-only, override
- notificationUri → Uri
-
The URI at which notifications of changes in this cursor's data will be
delivered. [...]
read-only
- position → int
-
The current position of the cursor in the row set. [...]
read-only
-
first
→ Map<
String, dynamic> -
Returns the first element. [...]
read-only, inherited
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- isNotEmpty → bool
-
Returns true if there is at least one element in this collection. [...]
read-only, inherited
-
last
→ Map<
String, dynamic> -
Returns the last element. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
-
single
→ Map<
String, dynamic> -
Checks that this iterable has only one element, and returns that element. [...]
read-only, inherited
Methods
-
close(
) → Future< void> - Closes the cursor, releasing all of its resources and making it completely invalid. [...]
-
get(
int columnIndex) → dynamic - Returns the value of the requested column.
-
getBlob(
int columnIndex) → Uint8List - Returns the value of the requested column as a byte array. [...]
-
getColumnCount(
) → int - Returns the total number of columns. [...]
-
getColumnIndex(
String columnName) → int - Returns the zero-based index for the given column name, or -1 if the column doesn't exist. [...]
-
getColumnName(
int columnIndex) → String - Returns the column name at the given zero-based column index. [...]
-
getColumnNames(
) → List< String> - Returns a string array holding the names of all of the columns in the result set in the order in which they were listed in the result. [...]
-
getCount(
) → int - Returns the number of rows in the cursor. [...]
-
getDouble(
int columnIndex) → double - Returns the value of the requested column as a double. [...]
-
getExtras(
) → Bundle - Returns a bundle of extra values. [...]
-
getFloat(
int columnIndex) → double - Returns the value of the requested column as a float. [...]
-
getInt(
int columnIndex) → int - Returns the value of the requested column as an int. [...]
-
getLong(
int columnIndex) → int - Returns the value of the requested column as a long. [...]
-
getNotificationUri(
) → Uri - Return the URI at which notifications of changes in this cursor's data will be delivered. [...]
-
getPosition(
) → int - Returns the current position of the cursor in the row set. [...]
-
getShort(
int columnIndex) → int - Returns the value of the requested column as a short. [...]
-
getString(
int columnIndex) → String - Returns the value of the requested column as a string. [...]
-
getType(
int columnIndex) → int - Returns data type of the given column's value. [...]
-
isNull(
int columnIndex) → bool -
Returns
true
if the value in the indicated column is null. [...] -
move(
int offset) → bool - Moves the cursor by a relative amount, forward or backward, from the current position. [...]
-
moveToFirst(
) → bool - Moves the cursor to the first row. [...]
-
moveToLast(
) → bool - Moves the cursor to the last row. [...]
-
moveToNext(
) → bool - Moves the cursor to the next row. [...]
-
moveToPosition(
int position) → bool - Moves the cursor to an absolute position. [...]
-
moveToPrevious(
) → bool - Moves the cursor to the previous row. [...]
-
any(
bool test(E element)) → bool -
Checks whether any element of this iterable satisfies
test
. [...]inherited -
cast<
R> () → Iterable< R> -
Provides a view of this iterable as an iterable of
R
instances. [...]inherited -
contains(
Object element) → bool -
Returns true if the collection contains an element equal to
element
. [...]inherited -
elementAt(
int index) → Map< String, dynamic> -
Returns the
index
th element. [...]inherited -
every(
bool test(E element)) → bool -
Checks whether every element of this iterable satisfies
test
. [...]inherited -
expand<
T> (Iterable< T> f(E element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements. [...]
inherited
-
firstWhere(
bool test(E element), { Map< String, dynamic> orElse() }) → Map<String, dynamic> -
Returns the first element that satisfies the given predicate
test
. [...]inherited -
fold<
T> (T initialValue, T combine(T previousValue, E element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value [...]
inherited
-
followedBy(
Iterable< Map< other) → Iterable<String, dynamic> >Map< String, dynamic> > -
Returns the lazy concatentation of this iterable and
other
. [...]inherited -
forEach(
void f(E element)) → void -
Applies the function
f
to each element of this collection in iteration order.inherited -
join(
[String separator = "" ]) → String -
Converts each element to a String and concatenates the strings. [...]
inherited
-
lastWhere(
bool test(E element), { Map< String, dynamic> orElse() }) → Map<String, dynamic> -
Returns the last element that satisfies the given predicate
test
. [...]inherited -
map<
T> (T f(E e)) → Iterable< T> -
Returns a new lazy Iterable with elements that are created by
calling
f
on each element of thisIterable
in iteration order. [...]inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
reduce(
Map< String, dynamic> combine(E value, E element)) → Map<String, dynamic> -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function. [...]
inherited
-
singleWhere(
bool test(E element), { Map< String, dynamic> orElse() }) → Map<String, dynamic> -
Returns the single element that satisfies
test
. [...]inherited -
skip(
int count) → Iterable< Map< String, dynamic> > -
Returns an Iterable that provides all but the first
count
elements. [...]inherited -
skipWhile(
bool test(E value)) → Iterable< Map< String, dynamic> > -
Returns an
Iterable
that skips leading elements whiletest
is satisfied. [...]inherited -
take(
int count) → Iterable< Map< String, dynamic> > -
Returns a lazy iterable of the
count
first elements of this iterable. [...]inherited -
takeWhile(
bool test(E value)) → Iterable< Map< String, dynamic> > -
Returns a lazy iterable of the leading elements satisfying
test
. [...]inherited -
toList(
{bool growable: true }) → List< Map< String, dynamic> > -
Creates a List containing the elements of this Iterable. [...]
inherited
-
toSet(
) → Set< Map< String, dynamic> > -
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(E element)) → Iterable< Map< String, dynamic> > -
Returns a new lazy Iterable with all elements that satisfy the
predicate
test
. [...]inherited -
whereType<
T> () → Iterable< T> -
Returns a new lazy Iterable with all elements that have type
T
. [...]inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited
Constants
- FIELD_TYPE_BLOB → const int
-
Value returned by getType() if the specified column type is blob. [...]
4
- FIELD_TYPE_FLOAT → const int
-
Value returned by getType() if the specified column type is float. [...]
2
- FIELD_TYPE_INTEGER → const int
-
Value returned by getType() if the specified column type is integer. [...]
1
- FIELD_TYPE_NULL → const int
-
Value returned by getType() if the specified column is null. [...]
0
- FIELD_TYPE_STRING → const int
-
Value returned by getType() if the specified column type is string. [...]
3