GetProtocolsResponse$2.fromJson constructor

GetProtocolsResponse$2.fromJson(
  1. Map<String, Object?> json
)

Implementation

GetProtocolsResponse$2.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,
      locationFields =
          (json['location_fields'] as List).map((v) => v as String).toList(),
      userFields =
          (json['user_fields'] as List).map((v) => v as String).toList(),
      instances = ((v) => v != null
          ? (v as List)
              .map((v) => Instances$2.fromJson(v as Map<String, Object?>))
              .toList()
          : null)(json['instances']);