params property

Map<String, dynamic>? params
getter/setter pair

Optional HTTP params appended to the JSON body of each HTTP request.

Example

CoffeeBackgroundGeolocation.init(Config(
  url: 'https://my-server.com/locations',
  params: {
    'user_id': 1234,
    'device_id': 'abc123'
  }
));

Observing the HTTP request arriving at your server:

POST /locations
{
  "latitude": 45.51927004945047,
  "longitude": -73.61650072045029
  "user_id": 1234,  // <-- params appended to the data.
  "device_id": 'abc123'
}

See also: HTTP Guide at HttpEvent.

Implementation

///
 /// ## Example
 ///
 /// ```dart
 /// CoffeeBackgroundGeolocation.init(Config(
 ///   url: 'https://my-server.com/locations',
 ///   params: {
 ///     'user_id': 1234,
 ///     'device_id': 'abc123'
 ///   }
 /// ));
 /// ```
 ///
 /// Observing the HTTP request arriving at your server:
 ///
 /// ```dart
 /// POST /locations
 /// {
 ///   "latitude": 45.51927004945047,
 ///   "longitude": -73.61650072045029
 ///   "user_id": 1234,  // <-- params appended to the data.
 ///   "device_id": 'abc123'
 /// }
 /// ```
 /// __See also:__ __HTTP Guide__ at [HttpEvent].
 ///
 Map<String, dynamic>? params;