HighlightConfig.fromJson constructor

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

Implementation

factory HighlightConfig.fromJson(Map<String, dynamic> json) {
  return HighlightConfig(
    showInfo: json.containsKey('showInfo') ? json['showInfo'] as bool : null,
    showStyles:
        json.containsKey('showStyles') ? json['showStyles'] as bool : null,
    showRulers:
        json.containsKey('showRulers') ? json['showRulers'] as bool : null,
    showAccessibilityInfo:
        json.containsKey('showAccessibilityInfo')
            ? json['showAccessibilityInfo'] as bool
            : null,
    showExtensionLines:
        json.containsKey('showExtensionLines')
            ? json['showExtensionLines'] as bool
            : null,
    contentColor:
        json.containsKey('contentColor')
            ? dom.RGBA.fromJson(json['contentColor'] as Map<String, dynamic>)
            : null,
    paddingColor:
        json.containsKey('paddingColor')
            ? dom.RGBA.fromJson(json['paddingColor'] as Map<String, dynamic>)
            : null,
    borderColor:
        json.containsKey('borderColor')
            ? dom.RGBA.fromJson(json['borderColor'] as Map<String, dynamic>)
            : null,
    marginColor:
        json.containsKey('marginColor')
            ? dom.RGBA.fromJson(json['marginColor'] as Map<String, dynamic>)
            : null,
    eventTargetColor:
        json.containsKey('eventTargetColor')
            ? dom.RGBA.fromJson(
              json['eventTargetColor'] as Map<String, dynamic>,
            )
            : null,
    shapeColor:
        json.containsKey('shapeColor')
            ? dom.RGBA.fromJson(json['shapeColor'] as Map<String, dynamic>)
            : null,
    shapeMarginColor:
        json.containsKey('shapeMarginColor')
            ? dom.RGBA.fromJson(
              json['shapeMarginColor'] as Map<String, dynamic>,
            )
            : null,
    cssGridColor:
        json.containsKey('cssGridColor')
            ? dom.RGBA.fromJson(json['cssGridColor'] as Map<String, dynamic>)
            : null,
    colorFormat:
        json.containsKey('colorFormat')
            ? ColorFormat.fromJson(json['colorFormat'] as String)
            : null,
    gridHighlightConfig:
        json.containsKey('gridHighlightConfig')
            ? GridHighlightConfig.fromJson(
              json['gridHighlightConfig'] as Map<String, dynamic>,
            )
            : null,
    flexContainerHighlightConfig:
        json.containsKey('flexContainerHighlightConfig')
            ? FlexContainerHighlightConfig.fromJson(
              json['flexContainerHighlightConfig'] as Map<String, dynamic>,
            )
            : null,
    flexItemHighlightConfig:
        json.containsKey('flexItemHighlightConfig')
            ? FlexItemHighlightConfig.fromJson(
              json['flexItemHighlightConfig'] as Map<String, dynamic>,
            )
            : null,
    contrastAlgorithm:
        json.containsKey('contrastAlgorithm')
            ? ContrastAlgorithm.fromJson(json['contrastAlgorithm'] as String)
            : null,
    containerQueryContainerHighlightConfig:
        json.containsKey('containerQueryContainerHighlightConfig')
            ? ContainerQueryContainerHighlightConfig.fromJson(
              json['containerQueryContainerHighlightConfig']
                  as Map<String, dynamic>,
            )
            : null,
  );
}