TraceletPlatform class abstract

The interface that platform implementations of Tracelet must extend.

Platform implementations should override all methods and provide concrete native implementations. The default implementation is PigeonTracelet, which uses Pigeon-generated type-safe channels.

Inheritance
  • Object
  • PlatformInterface
  • TraceletPlatform
Implementers

Constructors

TraceletPlatform()
Constructs a TraceletPlatform.

Properties

activityChangeEvents Stream<TlActivityChangeEvent>
Stream of activity change events.
no setter
authorizationEvents Stream<TlAuthorizationEvent>
Stream of authorization events (token refresh).
no setter
connectivityChangeEvents Stream<TlConnectivityChangeEvent>
Stream of connectivity change events.
no setter
enabledChangeEvents Stream<bool>
Stream of enabled-change events.
no setter
geofenceEvents Stream<TlGeofenceEvent>
Stream of geofence transition events.
no setter
geofencesChangeEvents Stream<TlGeofencesChangeEvent>
Stream of geofences change events (monitor set changed).
no setter
hashCode int
The hash code for this object.
no setterinherited
heartbeatEvents Stream<TlHeartbeatEvent>
Stream of heartbeat events.
no setter
httpEvents Stream<TlHttpEvent>
Stream of HTTP sync events.
no setter
locationEvents Stream<TlLocation>
Stream of location events.
no setter
motionChangeEvents Stream<TlLocation>
Stream of motion change events (stationary ↔ moving).
no setter
notificationActionEvents Stream<String>
Stream of notification action events (Android).
no setter
powerSaveChangeEvents Stream<bool>
Stream of power-save mode change events.
no setter
providerChangeEvents Stream<TlProviderChangeEvent>
Stream of provider change events.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scheduleEvents Stream<TlState>
Stream of schedule events (start/stop transitions).
no setter
watchPositionEvents Stream<TlLocation>
Stream of watchPosition events.
no setter

Methods

addGeofence(Map<String, Object?> geofence) Future<bool>
Add a single geofence. Returns true on success.
addGeofences(List<Map<String, Object?>> geofences) Future<bool>
Add multiple geofences. Returns true on success.
addPrivacyZone(Map<String, Object?> zone) Future<bool>
Add a single privacy zone. Returns true on success.
addPrivacyZones(List<Map<String, Object?>> zones) Future<bool>
Add multiple privacy zones. Returns true on success.
canScheduleExactAlarms() Future<bool>
Check whether the app can schedule exact alarms (Android 12+ / API 31+).
changePace(bool isMoving) Future<bool>
Toggle motion state. isMoving = true forces moving mode.
clearRouteContext() Future<bool>
Clear the current route context. Subsequent locations will have no route context attached.
destroyLocation(String uuid) Future<bool>
Destroy a single location by uuid.
destroyLocations() Future<bool>
Destroy all stored locations.
destroyLog() Future<bool>
Destroy all log entries.
destroySyncedLocations() Future<int>
Destroy only locations that have been synced. Returns count deleted.
emailLog(String email) Future<bool>
Email the log to email.
encryptDatabase() Future<bool>
Migrate an existing unencrypted database to encrypted (one-time).
geofenceExists(String identifier) Future<bool>
Check if a geofence with identifier exists.
getAttestationToken() Future<Map<String, Object?>?>
Request a fresh attestation token from the platform.
getAuditProof(String uuid) Future<Map<String, Object?>?>
Get the audit proof for a specific location record by uuid.
getCarbonReport([Map<String, Object?>? query]) Future<Map<String, Object?>>
Get cumulative carbon emissions report.
getCount([Map<String, Object?>? query]) Future<int>
Get the count of stored locations.
getCurrentPosition(Map<String, Object?> options) Future<Map<String, Object?>>
Get the current position. Returns Location map.
getDeadReckoningState() Future<Map<String, Object?>?>
Get the current dead reckoning state.
getDeviceInfo() Future<Map<String, Object?>>
Get device info (model, manufacturer, OS version).
getGeofence(String identifier) Future<Map<String, Object?>?>
Get a single geofence by identifier.
getGeofences() Future<List<Map<String, Object?>>>
Get all registered geofences.
getLastKnownLocation([Map<String, Object?>? options]) Future<Map<String, Object?>>
Get the last known location without requesting a new fix.
getLocations([Map<String, Object?>? query]) Future<List<Map<String, Object?>>>
Get stored locations. Returns list of Location maps.
getLog([Map<String, Object?>? query]) Future<String>
Get the plugin log. Optional query for filtering.
getMotionPermissionStatus() Future<int>
Get the motion / activity recognition permission status.
getNotificationPermissionStatus() Future<int>
Get the notification permission status (Android 13+ / API 33+ only).
getOdometer() Future<double>
Get the current odometer value in meters.
getPermissionStatus() Future<int>
Get current permission status without triggering any dialog.
getPrivacyZones() Future<List<Map<String, Object?>>>
Get all registered privacy zones.
getProviderState() Future<Map<String, Object?>>
Get the current location provider state.
getSensors() Future<Map<String, Object?>>
Get available device sensors info.
getSettingsHealth() Future<Map<String, Object?>>
Get OEM settings health information.
getState() Future<Map<String, Object?>>
Get the current plugin state. Returns State map.
insertLocation(Map<String, Object?> params) Future<String>
Insert a custom location into the store. Returns UUID.
isDatabaseEncrypted() Future<bool>
Check if the current database is encrypted.
isIgnoringBatteryOptimizations() Future<bool>
Whether the app is ignoring battery optimizations (Android only).
isPowerSaveMode() Future<bool>
Whether the device is in power-save mode.
log(String level, String message) Future<bool>
Write a custom log entry at level with message.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openExactAlarmSettings() Future<bool>
Open the device Settings screen for granting exact alarm permission.
openOemSettings(String label) Future<bool>
Open an OEM-specific settings screen by label.
playSound(String name) Future<bool>
Play a debug sound by name.
ready(Map<String, Object?> config) Future<Map<String, Object?>>
Initialize the plugin with the given config. Returns the current State as a map.
registerHeadlessHeadersCallback(List<int> callbackIds) Future<bool>
Register a headless headers callback for background token recovery.
registerHeadlessSyncBodyBuilder(List<int> callbackIds) Future<bool>
Register a headless sync body builder for background custom payloads.
registerHeadlessTask(List<int> callbackIds) Future<bool>
Register a headless task callback for background event dispatch.
removeGeofence(String identifier) Future<bool>
Remove a geofence by identifier. Returns true on success.
removeGeofences() Future<bool>
Remove all geofences. Returns true on success.
removePrivacyZone(String identifier) Future<bool>
Remove a privacy zone by identifier. Returns true on success.
removePrivacyZones() Future<bool>
Remove all privacy zones. Returns true on success.
requestMotionPermission() Future<int>
Request motion / activity recognition permission asynchronously.
requestNotificationPermission() Future<int>
Request notification permission asynchronously (Android 13+ / API 33+).
requestPermission() Future<int>
Request location permission asynchronously.
requestSettings(String action) Future<bool>
Request a system settings page (e.g., battery optimization).
requestTemporaryFullAccuracy(String purpose) Future<int>
Request temporary full accuracy (iOS 14+). Returns accuracy status.
reset([Map<String, Object?>? config]) Future<Map<String, Object?>>
Reset to default configuration. Optionally apply config. Returns State map.
setConfig(Map<String, Object?> config) Future<Map<String, Object?>>
Update configuration. Returns State map.
setDynamicHeaders(Map<String, String> headers) Future<bool>
Update dynamic HTTP headers that are merged with static config headers at sync time.
setOdometer(double value) Future<Map<String, Object?>>
Set the odometer value. Returns Location map at the reset point.
setRouteContext(Map<String, Object?> context) Future<bool>
Set the current route context that will be persisted with every subsequently recorded location.
showSettings(String action) Future<bool>
Show a system settings page (e.g., location settings).
start() Future<Map<String, Object?>>
Start location tracking. Returns State map.
startBackgroundTask() Future<int>
Start a long-running background task. Returns task ID.
startGeofences() Future<Map<String, Object?>>
Start geofence-only tracking mode. Returns State map.
startPeriodic() Future<Map<String, Object?>>
Start periodic one-shot location tracking mode. Returns State map.
startSchedule() Future<Map<String, Object?>>
Start schedule-based tracking. Returns State map.
stop() Future<Map<String, Object?>>
Stop location tracking. Returns State map.
stopBackgroundTask(int taskId) Future<int>
Signal completion of a background task by taskId.
stopSchedule() Future<Map<String, Object?>>
Stop schedule-based tracking. Returns State map.
stopWatchPosition(int watchId) Future<bool>
Stop a watch started by watchPosition.
sync() Future<List<Map<String, Object?>>>
Manually trigger HTTP sync. Returns synced locations.
toString() String
A string representation of this object.
inherited
verifyAuditTrail() Future<Map<String, Object?>>
Verify the integrity of the tamper-proof location audit trail.
watchPosition(Map<String, Object?> options) Future<int>
Start watching position at an interval. Returns a watch ID.

Operators

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

Static Properties

instance TraceletPlatform
The current platform implementation.
getter/setter pair

Constants

methodChannelName → const String
The MethodChannel path used for request/response calls.