CSSStyle.fromJson constructor

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

Implementation

factory CSSStyle.fromJson(Map<String, dynamic> json) {
  return CSSStyle(
    styleSheetId: json.containsKey('styleSheetId')
        ? StyleSheetId.fromJson(json['styleSheetId'] as String)
        : null,
    cssProperties: (json['cssProperties'] as List)
        .map((e) => CSSProperty.fromJson(e as Map<String, dynamic>))
        .toList(),
    shorthandEntries: (json['shorthandEntries'] as List)
        .map((e) => ShorthandEntry.fromJson(e as Map<String, dynamic>))
        .toList(),
    cssText: json.containsKey('cssText') ? json['cssText'] as String : null,
    range: json.containsKey('range')
        ? SourceRange.fromJson(json['range'] as Map<String, dynamic>)
        : null,
  );
}