fromMap static method

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

Gets a possible URLProtectionSpaceHttpAuthCredentials instance from a Map value.

Implementation

static URLProtectionSpaceHttpAuthCredentials? fromMap(
  Map<String, dynamic>? map, {
  EnumMethod? enumMethod,
}) {
  if (map == null) {
    return null;
  }
  final instance = URLProtectionSpaceHttpAuthCredentials(
    credentials: map['credentials'] != null
        ? List<URLCredential>.from(
            map['credentials'].map(
              (e) => URLCredential.fromMap(
                e?.cast<String, dynamic>(),
                enumMethod: enumMethod,
              )!,
            ),
          )
        : null,
    protectionSpace: URLProtectionSpace.fromMap(
      map['protectionSpace']?.cast<String, dynamic>(),
      enumMethod: enumMethod,
    ),
  );
  return instance;
}