fromMap static method

DeviceInfo fromMap(
  1. dynamic data
)

Implementation

static DeviceInfo fromMap(data) {
  DeviceInfo di = DeviceInfo();
  di.azimuth = data["azimuth"] as num;
  di.errorCode = data["errorCode"] as int?;
  di.id = data["id"] as String;
  di.location = data["location"] as int;
  di.r = data["r"] as num;
  di.stepCount = data["stepCount"] as int?;
  di.subLocation = data["subLocation"] as int;
  di.stepLength = data["stepLength"] as num?;

  di.x = data["x"] as num;
  di.y = data["y"] as num;

  for (var zone in data["zones"]) {
    di.zones.add(Zone.fromMap(zone));
  }

  for (var path in data["paths"]) {
    di.paths.add(RoutePath.fromMap(path));
  }

  return di;
}