extras property

Map<String, dynamic>? extras
final

Optional arbitrary key/values {} applied to each recorded location.

Note: See HttpConfig for more information.

Example

BackgroundGeolocation.ready(Config(
  persistence: PersistenceConfig(
    extras: {
      'device_id': 'abc123'
    }
  ),
  http: HttpConfig(
    url: 'https://my-server.com/locations',
    params: {
      'device_id': 'abc123'
    }
  )
));

Observing incoming requests at your server:

- POST /locations
{
  "device_id": "abc123" // <-- params appended to root of JSON
  "location": {
    "coords": {
      "latitude": 45.51927004945047,
      "longitude": -73.61650072045029,
      .
      .
      .
    },
    "extras": {  // <-- extras appended to *each* location
      "route_id": 1234
    }
  }
}

See also: HTTP Guide at HttpConfig.

Implementation

final Map<String, dynamic>? extras;