Protocol.fromJson constructor

Protocol.fromJson(
  1. Map<String, Object?> json
)

Implementation

Protocol.fromJson(Map<String, Object?> json)
    : fieldTypes = (json['field_types'] as Map<String, Object?>).map((k, v) =>
          MapEntry(k, FieldType.fromJson(v as Map<String, Object?>))),
      icon = json['icon'] as String,
      instances = (json['instances'] as List)
          .map((v) => ProtocolInstance.fromJson(v as Map<String, Object?>))
          .toList(),
      locationFields =
          (json['location_fields'] as List).map((v) => v as String).toList(),
      userFields =
          (json['user_fields'] as List).map((v) => v as String).toList();