setSyncBodyBuilder abstract method
- SyncBodyBuilder? builder
Sets a callback to build custom HTTP sync body.
When set, this callback is invoked before each sync request. The returned Map is used as the HTTP request body instead of the default location array format.
Example:
Locus.setSyncBodyBuilder((locations, extras) async {
return {
'ownerId': extras['ownerId'],
'polygons': locations.map((l) => l.coords.toJson()).toList(),
};
});
Implementation
void setSyncBodyBuilder(SyncBodyBuilder? builder);