HostAlias.fromJson constructor

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

Creates a HostAlias from JSON data.

Implementation

factory HostAlias.fromJson(Map<String, dynamic> json) {
  final tempHostnamesJson = json['hostnames'];
  final tempIpJson = json['ip'];

  final List<String>? tempHostnames =
      tempHostnamesJson != null ? List<String>.from(tempHostnamesJson) : null;
  final String? tempIp = tempIpJson;

  return HostAlias(
    hostnames: tempHostnames,
    ip: tempIp,
  );
}