NativeCursor class
The cursor that calls into platform Cursor https://developer.android.com/reference/android/database/Cursor
After you are done with using the cursor, you should call close on it. This means that all operations on cursor should be wrapped in try-finally block:
final NativeCursor? cursor = ...;
try {
// do something with cursor
} finally {
cursor?.close();
}
In case you forget to do that, the plugin will do this for you when the Flutter app closes, but it better to not forget it.
The operations are packed into NativeCursorGetBatch to achieve the best performance by reducing Flutter channel bottle-necking. Cursor operations can often be represented as batches, such as reading all values from each row.
Returned from AndroidContentResolver.query.
This class has no native counterpart, i.e. only Dart can call in such a manner to platform, but not otherwise. That's because other apps' abstract cursors can't be forced to use the batching. Instead of this CursorData is used to transfer data once to platform, which leads to certain limitations in this API, but will work for the most use cases.
See also:
- CursorData, which is a class, returned from AndroidContentProvider.query.
- Inheritance
-
- Object
- Interoperable
- NativeCursor
Constructors
- NativeCursor.fromId(String id)
- Creates native cursor from an existing ID.
Properties
Methods
-
batchedGet(
) → NativeCursorGetBatch - Creates a batch operation of getting data from cursor.
-
close(
) → Future< void> - Closes the cursor, releasing all of its resources and making it completely invalid https://developer.android.com/reference/android/database/Cursor#close()
-
getExtras(
) → Future< BundleMap> - https://developer.android.com/reference/kotlin/android/database/Cursor#getextras
-
getNotificationUri(
) → Future< String?> - https://developer.android.com/reference/kotlin/android/database/Cursor#getnotificationuri
-
getNotificationUris(
) → Future< List< String> ?> - https://developer.android.com/reference/kotlin/android/database/Cursor#getnotificationuris
-
move(
int offset) → Future< bool> - https://developer.android.com/reference/android/database/Cursor#move(int)
-
moveToFirst(
) → Future< bool> - https://developer.android.com/reference/kotlin/android/database/Cursor#movetofirst
-
moveToLast(
) → Future< bool> - https://developer.android.com/reference/kotlin/android/database/Cursor#movetolast
-
moveToNext(
) → Future< bool> - https://developer.android.com/reference/kotlin/android/database/Cursor#movetonext
-
moveToPosition(
int position) → Future< bool> - https://developer.android.com/reference/kotlin/android/database/Cursor#movetoposition
-
moveToPrevious(
) → Future< bool> - https://developer.android.com/reference/kotlin/android/database/Cursor#movetoprevious
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerContentObserver(
ContentObserver observer) → Future< void> - https://developer.android.com/reference/kotlin/android/database/Cursor#registercontentobserver
-
respond(
BundleMap extras) → Future< BundleMap> - https://developer.android.com/reference/kotlin/android/database/Cursor#respond
-
setExtras(
BundleMap extras) → Future< void> - https://developer.android.com/reference/kotlin/android/database/Cursor#setextras
-
setNotificationUri(
String uri) → Future< void> - https://developer.android.com/reference/kotlin/android/database/Cursor#setnotificationuri
-
setNotificationUris(
List< String> uris) → Future<void> - https://developer.android.com/reference/kotlin/android/database/Cursor#setnotificationuris
-
toString(
) → String -
A string representation of this object.
override
-
unregisterContentObserver(
ContentObserver observer) → Future< void> - https://developer.android.com/reference/kotlin/android/database/Cursor#unregistercontentobserver
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
supportedFieldTypes
→ const List<
Type> - Supported types in Android SQLite.