CapabilityInfo.fromJson constructor

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

Implementation

factory CapabilityInfo.fromJson(Map<String, dynamic> json) {
  return CapabilityInfo(
      name: json["name"] as String? ?? "",
      associatedDevices: (json["associatedNodes"] as List? ?? [])
          .map((nodeJson) => WearOsDevice.fromRawData(
              channel,
              (nodeJson as Map? ?? {})
                  .map((key, value) => MapEntry(key.toString(), value))))
          .toSet());
}