DashboardItem.fromJson constructor

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

Implementation

DashboardItem.fromJson(Map<String, dynamic> json)
    : this.position = json['position'],
      this.width = json['width'],
      this.height = json['height'],
      this.iotWidget = json['widget_id'] == 'widget-flow'
          ? null
          : SamIotWidgets.instance.collection
              .singleWhereOrNull((wgt) => wgt.id == json['widget_id']),
      this.analyticId = ifNullReturnEmpty(json['analytic_id']),
      this.elementResources = (json['element_resources'] as List)
          .map((r) => ElementResources.fromJson(r))
          .toList();