EndpointHints.fromJson constructor

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

Creates a EndpointHints from JSON data.

Implementation

factory EndpointHints.fromJson(Map<String, dynamic> json) {
  final tempForZonesJson = json['forZones'];

  final List<ForZone>? tempForZones = tempForZonesJson != null
      ? List<dynamic>.from(tempForZonesJson)
          .map(
            (e) => ForZone.fromJson(
              Map<String, dynamic>.from(e),
            ),
          )
          .toList()
      : null;

  return EndpointHints(
    forZones: tempForZones,
  );
}