LocationQuery class
Describes a paged query for BackgroundGeolocation.getLocations.
A locations read is a paging operation: fetch a bounded slice of the SDK's SQLite database so a large table can be drained incrementally rather than materialised all at once. Unlike SQLQuery (a time-window query over the log database), the vocabulary here is paging-first: limit, offset (or the 0-indexed page convenience), and order.
// Newest 500 records
List page = await BackgroundGeolocation.getLocations(LocationQuery(
limit: 500,
order: LocationQuery.ORDER_DESC
));
// Drain the table one page at a time
int total = await BackgroundGeolocation.count;
for (int page = 0; page * 500 < total; page++) {
List records = await BackgroundGeolocation.getLocations(
LocationQuery(limit: 500, page: page)
);
// ...process records
}
Constructors
- LocationQuery({int? limit, int? offset, int? page, int? order})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- limit ↔ int?
-
Maximum number of records to return. Without a limit, every record is returned.
getter/setter pair
- offset ↔ int?
-
Number of records to skip before returning results (offset-based paging).
An explicit offset takes precedence over page.
getter/setter pair
- order ↔ int?
-
Ordering of results: LocationQuery.ORDER_ASC or LocationQuery.ORDER_DESC.
Defaults to the configured
locationsOrderDirection.getter/setter pair - page ↔ int?
-
Zero-indexed page number — a convenience over offset (
offset = page * limit). Page0is the first page. Requires limit.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> -
Return
Maprepresentation ofLocationQueryfor communication to the native platform. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- ORDER_ASC → const int
- ORDER_DESC → const int