IndoorRendererOptionsIcon.fromJson constructor

IndoorRendererOptionsIcon.fromJson(
  1. Map<String, dynamic> json
)

Created WoosIcon object from JSON Data

Implementation

IndoorRendererOptionsIcon.fromJson(Map<String, dynamic> json) {
  assert(json['url'] != null, 'url should not be null');
  url = json['url'].toString();

  if (json['scaledSize'] != null) {
    if (json['scaledSize'] is Map<String, dynamic>) {
      scaledSize = WoosSize.fromJson(json['scaledSize']);
    } else {
      Util.showWarning(
          "`scaledSize` should be an object of Map<String, dynamic>");
    }
  } else {
    scaledSize = null;
  }

  if (json['anchor'] != null) {
    if (json['anchor'] is Map<String, dynamic>) {
      anchor = WoosPoint.fromJson(json['anchor']);
    } else {
      Util.showWarning(
          "`anchor` should be an object of Map<String, dynamic>");
    }
  } else {
    anchor = null;
  }
}