LiveLocationConfig class
Configuration for live location tracking with server sync.
Example:
final config = LiveLocationConfig(
apiBaseUrl: 'https://api.example.com',
apiEndpoint: '/api/v1/locations',
updateIntervalSeconds: 10,
distanceFilterMeters: 10,
syncIntervalMinutes: 5,
maxRetryAttempts: 3,
);
Constructors
-
LiveLocationConfig({required String apiBaseUrl, required String apiEndpoint, int updateIntervalSeconds = 10, double distanceFilterMeters = 10, int syncIntervalMinutes = 5, int maxRetryAttempts = 3, int apiTimeoutSeconds = 30, String? authToken, Map<
String, String> ? customHeaders, AndroidSettings androidSettings = const AndroidSettings(accuracy: LocationAccuracy.NAVIGATION, interval: 10, distanceFilter: 10, androidNotificationSettings: AndroidNotificationSettings(notificationTitle: 'Location Tracking', notificationMsg: 'Tracking your location in background')), IOSSettings iosSettings = const IOSSettings(accuracy: LocationAccuracy.NAVIGATION, distanceFilter: 10, showsBackgroundLocationIndicator: true, stopWithTerminate: false)}) -
const
Properties
- androidSettings → AndroidSettings
-
Android-specific settings
final
- apiBaseUrl → String
-
Base URL for the API server
final
- apiEndpoint → String
-
API endpoint for location updates (relative to baseUrl)
final
- apiTimeoutSeconds → int
-
Timeout in seconds for API requests
Default: 30 seconds
final
- authToken → String?
-
Optional authorization token for API requests
final
-
customHeaders
→ Map<
String, String> ? -
Optional custom headers for API requests
final
- distanceFilterMeters → double
-
Minimum distance in meters to trigger a location update
Default: 10 meters
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iosSettings → IOSSettings
-
iOS-specific settings
final
- maxRetryAttempts → int
-
Maximum number of retry attempts for failed syncs
Default: 3
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- syncIntervalMinutes → int
-
Interval in minutes between sync attempts
Default: 5 minutes
final
- updateIntervalSeconds → int
-
Interval in seconds between location updates
Default: 10 seconds
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - Converts config to a map for passing to native code
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited