MatrixCursor class

A mutable cursor implementation backed by an array of objects. Use addRow() to add rows. Automatically expands internal capacity as needed.

See: https://developer.android.com/reference/android/database/MatrixCursor

Inheritance

Constructors

MatrixCursor.empty()
Constructs an empty cursor.
MatrixCursor.from({@required List<String> columns, @required List<List> rows })
Constructs a cursor from the provided column/row data.

Properties

isClosed bool
Returns true if the cursor is closed. [...]
read-only, override
columnCount int
The total number of columns. [...]
read-only, inherited
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, inherited
count int
The number of rows in the cursor. [...]
read-only, inherited
extras Bundle
A bundle of extra values. [...]
read-only, inherited
first Map<String, dynamic>
Returns the first element. [...]
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
isAfterLast bool
Returns whether the cursor is pointing to the position after the last row. [...]
read-only, inherited
isBeforeFirst bool
Returns whether the cursor is pointing to the position before the first row. [...]
read-only, inherited
isEmpty bool
Returns true if there are no elements in this collection. [...]
read-only, inherited
isFirst bool
Returns whether the cursor is pointing to the first row. [...]
read-only, inherited
isLast bool
Returns whether the cursor is pointing to the last row. [...]
read-only, inherited
isNotEmpty bool
Returns true if there is at least one element in this collection. [...]
read-only, inherited
iterator Iterator<Map<String, dynamic>>
An iterator over the rows of this cursor. [...]
read-only, inherited
last Map<String, dynamic>
Returns the last element. [...]
read-only, inherited
length int
Returns the number of elements in this. [...]
read-only, inherited
notificationUri Uri
The URI at which notifications of changes in this cursor's data will be delivered. [...]
read-only, inherited
position int
The current position of the cursor in the row set. [...]
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

addRow(List columnValues) → void
Adds a new row to the end with the given column values. [...]
close() Future<void>
Closes the cursor, releasing all of its resources and making it completely invalid. [...]
override
get(int columnIndex) → dynamic
Returns the value of the requested column.
override
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. [...]
override
getCount() int
Returns the number of rows in the cursor. [...]
override
getPosition() int
Returns the current position of the cursor in the row set. [...]
override
moveToPosition(int position) bool
Moves the cursor to an absolute position. [...]
override
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 indexth 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<String, dynamic>> other) Iterable<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
getBlob(int columnIndex) Uint8List
Returns the value of the requested column as a byte array. [...]
inherited
getColumnCount() int
Returns the total number of columns. [...]
inherited
getColumnIndex(String columnName) int
Returns the zero-based index for the given column name, or -1 if the column doesn't exist. [...]
inherited
getColumnName(int columnIndex) String
Returns the column name at the given zero-based column index. [...]
inherited
getDouble(int columnIndex) double
Returns the value of the requested column as a double. [...]
inherited
getExtras() Bundle
Returns a bundle of extra values. [...]
inherited
getFloat(int columnIndex) double
Returns the value of the requested column as a float. [...]
inherited
getInt(int columnIndex) int
Returns the value of the requested column as an int. [...]
inherited
getLong(int columnIndex) int
Returns the value of the requested column as a long. [...]
inherited
getNotificationUri() Uri
Return the URI at which notifications of changes in this cursor's data will be delivered. [...]
inherited
getShort(int columnIndex) int
Returns the value of the requested column as a short. [...]
inherited
getString(int columnIndex) String
Returns the value of the requested column as a string. [...]
inherited
getType(int columnIndex) int
Returns data type of the given column's value. [...]
inherited
isNull(int columnIndex) bool
Returns true if the value in the indicated column is null. [...]
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 this Iterable in iteration order. [...]
inherited
move(int offset) bool
Moves the cursor by a relative amount, forward or backward, from the current position. [...]
inherited
moveToFirst() bool
Moves the cursor to the first row. [...]
inherited
moveToLast() bool
Moves the cursor to the last row. [...]
inherited
moveToNext() bool
Moves the cursor to the next row. [...]
inherited
moveToPrevious() bool
Moves the cursor to the previous row. [...]
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 while test 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