Location constructor

Location(
  1. dynamic params
)

Implementation

Location(dynamic params) {
  this.map = params;
  this.coords = new Coords(params['coords']);
  this.battery = new Battery(params['battery']);
  this.activity = new Activity(params['activity']);

  this.timestamp = params['timestamp'];
  this.age = params['age'];
  this.isMoving = params['is_moving'];
  this.uuid = params['uuid'];
  this.odometer = params['odometer'] * 1.0;

  this.sample = (params['sample'] != null) ? params['sample'] : false;
  this.event = (params['event'] != null) ? params['event'] : '';

  if (params['geofence'] != null) {
    this.geofence = new GeofenceEvent(params['geofence']);
  }
  this.mock = (params['mock'] != null) ? params['mock'] : false;

  if (params['extras'] != null) {
    this.extras = params['extras'];
  }
}