LocationQuery class
Query parameters for filtering location history.
Example:
final query = LocationQuery(
from: DateTime.now().subtract(Duration(hours: 24)),
to: DateTime.now(),
minAccuracy: 50.0,
limit: 100,
);
final locations = await Locus.location.queryLocations(query);
Constructors
- LocationQuery({DateTime? from, DateTime? to, double? minAccuracy, double? maxAccuracy, bool? isMoving, LocationBounds? bounds, int? limit, int offset = 0, LocationSortOrder sortOrder = LocationSortOrder.newestFirst})
-
Creates a location query.
const
- LocationQuery.lastHours(int hours, {int? limit})
-
Creates a query for the last N hours.
factory
- LocationQuery.today({int? limit})
-
Creates a query for today.
factory
Properties
- bounds → LocationBounds?
-
Bounding box for spatial filtering.
final
- from → DateTime?
-
Start of the time range (inclusive).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMoving → bool?
-
Only include locations where user was moving.
final
- limit → int?
-
Maximum number of results to return.
final
- maxAccuracy → double?
-
Maximum accuracy in meters (filters out more accurate locations).
final
- minAccuracy → double?
-
Minimum accuracy in meters (filters out less accurate locations).
final
- offset → int
-
Offset for pagination.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sortOrder → LocationSortOrder
-
Sort order for results.
final
- to → DateTime?
-
End of the time range (inclusive).
final
Methods
-
apply(
List< Location> locations) → List<Location> - Filters a list of locations according to this query.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → JsonMap - Converts to a JSON-serializable map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited