Parse from a json
factory TextEntity.fromJson(Map<String, dynamic> json) => TextEntity( offset: json['offset'], length: json['length'], type: TextEntityType.fromJson(json['type']), );