Domain.fromMap constructor
Implementation
factory Domain.fromMap(
Map<String, dynamic> map,
) {
map = {
'\$id': "",
'\$createdAt': "",
'\$updatedAt': "",
'domain': "",
'registrar': "",
'nameservers': "",
'expire': "",
'renewal': "",
'autoRenewal': false,
'renewalPrice': 0,
'teamId': "",
'dnsRecords': [],
...map,
};
return Domain(
$id: map['\$id'].toString(),
$createdAt: map['\$createdAt'].toString(),
$updatedAt: map['\$updatedAt'].toString(),
domain: map['domain'].toString(),
registrar: map['registrar'].toString(),
nameservers: map['nameservers'].toString(),
expire: map['expire'].toString(),
renewal: map['renewal'].toString(),
autoRenewal: map['autoRenewal'],
renewalPrice: map['renewalPrice'],
transferStatus: map['transferStatus'] != null
? enums.DomainTransferStatusEnum.values.firstWhere(
(e) => e.value == map['transferStatus'],
)
: null,
teamId: map['teamId'].toString(),
dnsRecords: List<DnsRecord>.from(
map['dnsRecords'].map((p) => DnsRecord.fromMap(p)),
),
);
}