fromJson static method

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

Implementation

static CPDFArrowAttr fromJson(Map<String, dynamic> json) {
  return CPDFArrowAttr(
    borderColor: HexColor.fromHex(json['borderColor']),
    borderAlpha: json['borderAlpha'] ?? 128,
    borderWidth: json['borderWidth'] ?? 2.0,
    borderStyle: json['borderStyle'] != null
        ? CPDFBorderStyle(
            style: CPDFAnnotBorderStyle.values
                .firstWhere((e) => e.name == json['borderStyle']['style']),
            dashGap: json['borderStyle']['dashGap'] ?? 0)
        : const CPDFBorderStyle.solid(),
    headType: CPDFLineType.fromString(json['startLineType']),
    tailType: CPDFLineType.fromString(json['tailLineType']),
  );
}