SyncBodyContext class
Context passed to a custom sync body builder callback.
Contains the locations about to be synced. The builder returns a
Map<String, Object?> that becomes the full HTTP request body,
giving integrators full control over the JSON structure.
Tracelet.setSyncBodyBuilder((context) {
return {
'deviceId': myDeviceId,
'taskId': currentTaskId,
'points': context.locations,
'sentAt': DateTime.now().toIso8601String(),
};
});
- Annotations
Constructors
-
SyncBodyContext({required List<
Map< locations})String, Object?> > -
Creates a new SyncBodyContext.
const
-
SyncBodyContext.fromMap(Map<
String, Object?> map) -
Creates a SyncBodyContext from a map.
factory
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, Object?> - Serializes to a map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited