UserLocation class
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
Constructors
- UserLocation.new({required String userId, required GeoPoint location, required Timestamp timestamp, double? speed, double? heading, double? accuracy})
- //////////// ////////////
-
UserLocation.fromMap(Map<
String, dynamic> map, String userId) -
////////////
////////////
Creates a UserLocation from a Firestore document map
factory
Properties
- accuracy → double?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- heading → double?
-
final
- location → GeoPoint
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- speed → double?
-
final
- timestamp → Timestamp
-
final
- userId → String
-
////////////
////////////
final
Methods
-
distanceTo(
GeoPoint other) → double - Calculates the distance to another location (in meters)
-
formattedSpeed(
{bool useImperialUnits = false}) → String - Formats the speed value with units (if available)
-
getAge(
) → Duration - //////////// //////////// Gets the age of the location data
-
getCardinalDirection(
) → String? - Gets a cardinal direction from the heading (if available)
-
isRecent(
{Duration threshold = const Duration(minutes: 2)}) → bool - Checks if the location data is recent (within a specified threshold)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - //////////// //////////// Converts UserLocation to a map for Firestore
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited