StickyPositionConstraint.fromJson constructor

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

Implementation

factory StickyPositionConstraint.fromJson(Map<String, dynamic> json) {
  return StickyPositionConstraint(
    stickyBoxRect:
        dom.Rect.fromJson(json['stickyBoxRect'] as Map<String, dynamic>),
    containingBlockRect: dom.Rect.fromJson(
        json['containingBlockRect'] as Map<String, dynamic>),
    nearestLayerShiftingStickyBox: json
            .containsKey('nearestLayerShiftingStickyBox')
        ? LayerId.fromJson(json['nearestLayerShiftingStickyBox'] as String)
        : null,
    nearestLayerShiftingContainingBlock:
        json.containsKey('nearestLayerShiftingContainingBlock')
            ? LayerId.fromJson(
                json['nearestLayerShiftingContainingBlock'] as String)
            : null,
  );
}