AssetTracking class
A singleton class that manages asset tracking functionality.
This class provides methods for initializing the tracking system, managing assets, handling trips, and configuring various tracking settings. It implements the observer pattern for tracking data callbacks.
Constructors
- AssetTracking()
-
Factory constructor that returns the singleton instance of AssetTracking.
factory
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
-
addDataListener(
OnTrackingDataCallBack callback) → void - Adds a listener for tracking data callbacks.
-
bindAsset(
{required String customId}) → Future< AssetResult< String> > - Binds an asset using a custom ID.
-
createAsset(
{required AssetProfile profile}) → Future< AssetResult< String> > - Creates a new asset with the provided profile.
-
deleteTrip(
{required String tripId}) → Future< AssetResult< String> > - Deletes a specific trip.
-
endTrip(
) → Future< AssetResult< String> > - Ends the current trip.
-
forceBindAsset(
{required String customId}) → Future< AssetResult< String> > - Forces the binding of an asset using a custom ID.
-
getActiveTripId(
) → Future< AssetResult< String?> > - Retrieves the ID of the currently active trip.
-
getAndroidNotificationConfig(
) → Future< AssetResult< AndroidNotificationConfig> > - Retrieves the current Android notification configuration.
-
getAssetDetail(
) → Future< AssetResult< AssetDetailInfo> > - Retrieves detailed information about the current asset.
-
getAssetId(
) → Future< AssetResult< String> > - Retrieves the current asset ID.
-
getDataTrackingConfig(
) → Future< AssetResult< DataTrackingConfig> > - Retrieves the current data tracking configuration.
-
getDefaultConfig(
) → Future< AssetResult< DefaultConfig> > - Retrieves the current default configuration.
-
getFakeGpsConfig(
) → Future< AssetResult< bool> > - Retrieves the current fake GPS configuration status.
-
getIOSNotificationConfig(
) → Future< AssetResult< IOSNotificationConfig> > - Retrieves the current iOS notification configuration.
-
getLocationConfig(
) → Future< AssetResult< LocationConfig> > - Retrieves the current location configuration.
-
getSummary(
{required String tripId}) → Future< AssetResult< TripSummary> > - Retrieves the summary of a specific trip.
-
getTrip(
{required String tripId}) → Future< AssetResult< TripInfo> > - Retrieves information about a specific trip.
-
getUserId(
) → Future< AssetResult< String> > -
initialize(
{required String apiKey}) → Future< bool> - Initializes the asset tracking system with the provided API key.
-
isTracking(
) → Future< AssetResult< bool> > - Checks if tracking is currently active.
-
isTripInProgress(
) → Future< AssetResult< bool> > - Checks if there is a trip currently in progress.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeAllDataListener(
) → void - Removes all tracking data callback listeners.
-
removeDataListener(
OnTrackingDataCallBack callback) → void - Removes a specific tracking data callback listener.
-
setAndroidNotificationConfig(
{required AndroidNotificationConfig config}) → Future< void> - Sets the Android notification configuration.
-
setDataTrackingConfig(
{required DataTrackingConfig config}) → Future< void> - Sets the data tracking configuration.
-
setDefaultConfig(
{required DefaultConfig config}) → Future< void> - Sets the default configuration for the tracking system.
-
setFakeGpsConfig(
{required bool allow}) → Future< void> - Sets whether fake GPS is allowed.
-
setIOSNotificationConfig(
{required IOSNotificationConfig config}) → Future< void> - Sets the iOS notification configuration.
-
setKeyOfHeaderField(
{required String key}) → Future< bool> - Sets the key for the header field in API requests. This method is used when setting a dynamic token. After calling this method to set the key, the API key will be set as a value in the request header. Normally, you don't need to call this method unless there is a need to set a dynamic API key.
-
setLocationConfig(
{required LocationConfig config}) → Future< void> - Sets the location tracking configuration.
-
setupUserId(
{required String userId}) → Future< AssetResult< String> > - Sets up the user ID for tracking.
-
startTracking(
) → Future< void> - Starts the asset tracking process.
-
startTrip(
{required TripProfile profile}) → Future< AssetResult< String> > - Starts a new trip with the provided profile.
-
stopTracking(
) → Future< void> - Stops the asset tracking process.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateAsset(
{required AssetProfile assetProfile}) → Future< AssetResult< String> > - Updates the asset profile with new information.
-
updateLocationConfig(
{required LocationConfig config}) → Future< void> - Updates the location tracking configuration.
-
updateTrip(
{required TripUpdateProfile profile}) → Future< AssetResult< String> > - Updates an existing trip with new information.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited