TextContent.fromJson constructor

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

Creates a TextContent from JSON.

Implementation

factory TextContent.fromJson(Map<String, dynamic> json) {
  return TextContent(
    value: json['value'] as String,
    annotations: (json['annotations'] as List<dynamic>)
        .map((e) => TextAnnotation.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}