Config class

Configuration API.

Instances of Config are consumed by CoffeeBackgroundGeolocation.init.

Example

Config params = new Config(
  desiredAccuracy: Config.DESIRED_ACCURACY_HIGH,
  distanceFilter: 10.0,
  stopOnTerminate: false,
  url: 'http://my.server.com',
  params: {
    "user_id": 123
  },
  headers: {
    "my-auth-token":"secret-key"
  }
);

CoffeeBackgroundGeolocation.init(params).then((State state) {
  print('[init] CoffeeBackgroundGeolocation is configured and ready to use');

  CoffeeBackgroundGeolocation.start();
});
Inheritance
Implementers

Constructors

Config.new({LocationConfig? location, String? serverUrl, Map<String, dynamic>? params, Map<String, dynamic>? headers, bool? stopOnTerminate, bool? debug, CoffeeBackgroundNotification? notification})

Properties

debug bool?
Configure the plugin to emit sound effects and local-notifications during development.
getter/setter pair
desiredAccuracy int?
Specify the desired accuracy of the geolocation system.
getter/setter pairinherited
distanceFilter double?
distanceFilter (Applicable for both iOS and Android)
getter/setter pairinherited
fastestLocationUpdateInterval int?
fastestLocationUpdateInterval (Android Only)
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, dynamic>?
Optional HTTP headers applied to each HTTP request.
getter/setter pair
location LocationConfig?
The configuration settings for location tracking.
getter/setter pair
locationUpdateInterval int?
locationUpdateInterval (Android Only)
getter/setter pairinherited
maxAcceptableAccuracy double?
maxAcceptableAccuracy (Applicable for both iOS and Android)
getter/setter pairinherited
maxAcceptableSpeedAccuracy double?
maxAcceptableSpeedAccuracy (Android Only)
getter/setter pairinherited
notification CoffeeBackgroundNotification?
(Android only) Configure the persistent foreground notification.
getter/setter pair
params Map<String, dynamic>?
Optional HTTP params appended to the JSON body of each HTTP request.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverUrl String?
Your server url where you wish to POST locations to.
getter/setter pair
stopOnTerminate bool?
Controls whether to continue location-tracking after application is terminated.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited