CSSRule.fromJson constructor
CSSRule.fromJson(
- Map<String, dynamic> json
)
Implementation
factory CSSRule.fromJson(Map<String, dynamic> json) {
return CSSRule(
styleSheetId: json.containsKey('styleSheetId')
? StyleSheetId.fromJson(json['styleSheetId'] as String)
: null,
selectorList:
SelectorList.fromJson(json['selectorList'] as Map<String, dynamic>),
nestingSelectors: json.containsKey('nestingSelectors')
? (json['nestingSelectors'] as List).map((e) => e as String).toList()
: null,
origin: StyleSheetOrigin.fromJson(json['origin'] as String),
style: CSSStyle.fromJson(json['style'] as Map<String, dynamic>),
media: json.containsKey('media')
? (json['media'] as List)
.map((e) => CSSMedia.fromJson(e as Map<String, dynamic>))
.toList()
: null,
containerQueries: json.containsKey('containerQueries')
? (json['containerQueries'] as List)
.map((e) => CSSContainerQuery.fromJson(e as Map<String, dynamic>))
.toList()
: null,
supports: json.containsKey('supports')
? (json['supports'] as List)
.map((e) => CSSSupports.fromJson(e as Map<String, dynamic>))
.toList()
: null,
layers: json.containsKey('layers')
? (json['layers'] as List)
.map((e) => CSSLayer.fromJson(e as Map<String, dynamic>))
.toList()
: null,
scopes: json.containsKey('scopes')
? (json['scopes'] as List)
.map((e) => CSSScope.fromJson(e as Map<String, dynamic>))
.toList()
: null,
ruleTypes: json.containsKey('ruleTypes')
? (json['ruleTypes'] as List)
.map((e) => CSSRuleType.fromJson(e as String))
.toList()
: null,
);
}