GeminiTextResponseModel.fromJson constructor

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

Convert JSON data to class instance

Implementation

GeminiTextResponseModel.fromJson(Map<String, dynamic> json) {
  if (json['candidates'] != null) {
    candidates = <Candidates>[];
    json['candidates'].forEach((v) {
      candidates!.add(Candidates.fromJson(v));
    });
  }
  promptFeedback = json['promptFeedback'] != null
      ? PromptFeedback.fromJson(json['promptFeedback'])
      : null;
}