UEpubHighlight.fromJson constructor

UEpubHighlight.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory UEpubHighlight.fromJson(Map<String, Object?> json) => UEpubHighlight(
  id: (json["id"] as String?) ?? "",
  position: UEpubPosition.decode(json["position"] as String?) ?? const UEpubPosition(spineIndex: 0),
  text: (json["text"] as String?) ?? "",
  createdAt: DateTime.tryParse((json["createdAt"] as String?) ?? "") ?? DateTime.now(),
  note: (json["note"] as String?) ?? "",
  color: (json["color"] as num?)?.toInt() ?? 0xFFFFEB3B,
);