fromJson static method
Create annotation from JSON
Implementation
static NoteAnnotation fromJson(Map<String, dynamic> json) {
return NoteAnnotation(
id: json['id'],
pageNumber: json['pageNumber'],
createdAt: DateTime.parse(json['createdAt']),
modifiedAt: DateTime.parse(json['modifiedAt']),
position: Offset(json['position'][0].toDouble(), json['position'][1].toDouble()),
text: json['text'],
backgroundColor: Color(json['backgroundColor']),
textColor: Color(json['textColor']),
fontSize: json['fontSize'].toDouble(),
);
}