CPDFTextStamp.fromJson constructor

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

Implementation

factory CPDFTextStamp.fromJson(Map<String, dynamic> json) {
  return CPDFTextStamp(
    content: json['content'] ?? '',
    date: json['date'] ?? '',
    shape: CPDFTextStampShape.values.firstWhere(
        (e) => e.name == json['shape'],
        orElse: () => CPDFTextStampShape.rect),
    color: CPDFTextStampColor.values.firstWhere(
        (e) => e.name == json['color'],
        orElse: () => CPDFTextStampColor.white),
  );
}