toJson method

Map<String, dynamic> toJson()

Convert data model to json

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  if (candidates != null) {
    data['candidates'] = candidates!.map((v) => v.toJson()).toList();
  }
  if (promptFeedback != null) {
    data['promptFeedback'] = promptFeedback!.toJson();
  }
  return data;
}