LocationSummary class
Summary of location history for a time period.
Provides aggregated statistics about movement and activity.
Example:
final summary = await Locus.getLocationSummary(date: DateTime.now());
print('Total distance: ${summary.totalDistanceMeters}m');
print('Moving time: ${summary.movingDuration}');
Constructors
-
LocationSummary({required double totalDistanceMeters, required Duration movingDuration, required Duration stationaryDuration, required int locationCount, double? averageSpeedMps, double? maxSpeedMps, DateTime? periodStart, DateTime? periodEnd, List<
FrequentLocation> frequentLocations = const [], double? averageAccuracyMeters}) -
Creates a location summary.
const
- LocationSummary.empty()
-
Creates an empty summary.
const
Properties
- averageAccuracyMeters → double?
-
Average accuracy of locations in meters.
final
- averageSpeedMps → double?
-
Average speed in meters per second (while moving).
final
-
frequentLocations
→ List<
FrequentLocation> -
Most frequently visited locations (clusters).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- locationCount → int
-
Number of location points.
final
- maxSpeedMps → double?
-
Maximum speed recorded in meters per second.
final
- movingDuration → Duration
-
Duration spent moving.
final
- movingPercent → double
-
Percentage of time spent moving.
no setter
- periodEnd → DateTime?
-
End of the summarized period.
final
- periodStart → DateTime?
-
Start of the summarized period.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stationaryDuration → Duration
-
Duration spent stationary.
final
- totalDistanceKm → double
-
Total distance in kilometers.
no setter
- totalDistanceMeters → double
-
Total distance traveled in meters.
final
- totalDistanceMiles → double
-
Total distance in miles.
no setter
- totalDuration → Duration
-
Total duration of the summarized period.
no setter
Methods
-
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