CorsPolicy.fromJson constructor
CorsPolicy.fromJson(
- Map json_
Implementation
CorsPolicy.fromJson(core.Map json_)
: this(
allowCredentials: json_.containsKey('allowCredentials')
? json_['allowCredentials'] as core.bool
: null,
allowHeaders: json_.containsKey('allowHeaders')
? (json_['allowHeaders'] as core.List)
.map((value) => value as core.String)
.toList()
: null,
allowMethods: json_.containsKey('allowMethods')
? (json_['allowMethods'] as core.List)
.map((value) => value as core.String)
.toList()
: null,
allowOriginRegexes: json_.containsKey('allowOriginRegexes')
? (json_['allowOriginRegexes'] as core.List)
.map((value) => value as core.String)
.toList()
: null,
allowOrigins: json_.containsKey('allowOrigins')
? (json_['allowOrigins'] as core.List)
.map((value) => value as core.String)
.toList()
: null,
disabled: json_.containsKey('disabled')
? json_['disabled'] as core.bool
: null,
exposeHeaders: json_.containsKey('exposeHeaders')
? (json_['exposeHeaders'] as core.List)
.map((value) => value as core.String)
.toList()
: null,
maxAge:
json_.containsKey('maxAge') ? json_['maxAge'] as core.int : null,
);