toJson method
Data model to json
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (content != null) {
data['content'] = content!.toJson();
}
data['finishReason'] = finishReason;
data['index'] = index;
if (safetyRatings != null) {
data['safetyRatings'] = safetyRatings!.map((v) => v.toJson()).toList();
}
return data;
}