fromMap static method

ClientCertChallenge? fromMap(
  1. Map<String, dynamic>? map, {
  2. EnumMethod? enumMethod,
})
override

Gets a possible ClientCertChallenge instance from a Map value.

Implementation

static ClientCertChallenge? fromMap(
  Map<String, dynamic>? map, {
  EnumMethod? enumMethod,
}) {
  if (map == null) {
    return null;
  }
  final instance = ClientCertChallenge(
    protectionSpace: URLProtectionSpace.fromMap(
      map['protectionSpace']?.cast<String, dynamic>(),
      enumMethod: enumMethod,
    )!,
    allowedCertificateAuthorities:
        map['allowedCertificateAuthorities'] != null
        ? List<String>.from(
            map['allowedCertificateAuthorities']!.cast<String>(),
          )
        : null,
    androidKeyTypes: map['keyTypes'] != null
        ? List<String>.from(map['keyTypes']!.cast<String>())
        : null,
    androidPrincipals: map['principals'] != null
        ? List<String>.from(map['principals']!.cast<String>())
        : null,
    isProxy: map['isProxy'],
    keyTypes: map['keyTypes'] != null
        ? List<String>.from(map['keyTypes']!.cast<String>())
        : null,
    mutuallyTrustedCertificates: map['mutuallyTrustedCertificates'] != null
        ? List<SslCertificate>.from(
            map['mutuallyTrustedCertificates'].map(
              (e) => SslCertificate.fromMap(
                e?.cast<String, dynamic>(),
                enumMethod: enumMethod,
              )!,
            ),
          )
        : null,
    principals: map['principals'] != null
        ? List<String>.from(map['principals']!.cast<String>())
        : null,
  );
  return instance;
}