Cors.fromJson constructor

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

Implementation

factory Cors.fromJson(Map<String, dynamic> json) {
  return Cors(
    allowCredentials: json['allowCredentials'] as bool?,
    allowHeaders: (json['allowHeaders'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    allowMethods: (json['allowMethods'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    allowOrigins: (json['allowOrigins'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    exposeHeaders: (json['exposeHeaders'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    maxAge: json['maxAge'] as int?,
  );
}