SmartLocation class

One import, everything works.

Constructors

SmartLocation()

Properties

hashCode int
The hash code for this object.
no setterinherited
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
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

backgroundLocationStream Stream<SmartPosition>
Get background position stream (listens to service updates).
no setter
locationStream Stream<SmartPosition>
Get live position stream.
no setter

Static Methods

addGeofence(GeofenceRegion region) → void
bearingBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude) double
Calculate bearing between two coordinates in degrees.
configure({SmartAccuracy accuracy = SmartAccuracy.balanced, RouteProviderType routeProvider = RouteProviderType.google, String? apiKey, bool debugMode = false}) → void
Configure global settings.
distanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude) double
Calculate distance between two coordinates in meters.
getCurrentPosition() Future<SmartPosition>
Get current position with a single call.
getRoute({required LatLng source, required LatLng destination}) Future<SmartRoute>
Get a route between two points. Authentication required via configure().
openAppSettings() Future<bool>
Opens the app settings.
openLocationSettings() Future<bool>
Opens the system location settings.
removeGeofence(String id) → void
startBackgroundTracking({SmartNotificationOptions? notificationOptions, dynamic onBackgroundStart(ServiceInstance)?}) Future<void>
Start background tracking (requires special permissions and setup).
startSimulation(SmartRoute route, {int speedKmH = 60}) → void
Starts simulating movement along the given route. Useful for testing without real GPS.
startTracking({SmartAccuracy accuracy = SmartAccuracy.balanced, int distanceFilter = 0}) Future<void>
Start live tracking.
stopBackgroundTracking() Future<void>
Stop background tracking.
stopSimulation() → void
Stops any active simulation.
stopTracking() Future<void>
Stop live tracking.