详情里的对话框切换动画ok
This commit is contained in:
68
lib/api/dto/plan_detail_dto.dart
Normal file
68
lib/api/dto/plan_detail_dto.dart
Normal file
@@ -0,0 +1,68 @@
|
||||
class PlanStepDto {
|
||||
num? id;
|
||||
String? stepIcon;
|
||||
String? stepContent;
|
||||
String? stepExplain;
|
||||
num? stepStatus;
|
||||
|
||||
PlanStepDto({this.id, this.stepIcon, this.stepContent, this.stepExplain, this.stepStatus});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map["id"] = id;
|
||||
map["step_icon"] = stepIcon;
|
||||
map["step_content"] = stepContent;
|
||||
map["step_explain"] = stepExplain;
|
||||
map["step_status"] = stepStatus;
|
||||
return map;
|
||||
}
|
||||
|
||||
PlanStepDto.fromJson(dynamic json) {
|
||||
id = json["id"];
|
||||
stepIcon = json["step_icon"];
|
||||
stepContent = json["step_content"];
|
||||
stepExplain = json["step_explain"];
|
||||
stepStatus = json["step_status"];
|
||||
}
|
||||
}
|
||||
|
||||
class PlanDetailDto {
|
||||
String? agentName;
|
||||
String? summary;
|
||||
String? dialog;
|
||||
List<PlanStepDto> stepsList;
|
||||
List<String> suggestionsList;
|
||||
|
||||
PlanDetailDto({
|
||||
this.agentName,
|
||||
this.summary,
|
||||
this.dialog,
|
||||
List<PlanStepDto>? stepsList,
|
||||
List<String>? suggestionsList,
|
||||
}) : stepsList = stepsList ?? [],
|
||||
suggestionsList = suggestionsList ?? [];
|
||||
|
||||
factory PlanDetailDto.fromJson(Map<String, dynamic> json) {
|
||||
return PlanDetailDto(
|
||||
agentName: json["agent_name"],
|
||||
summary: json["summary"],
|
||||
dialog: json["dialog"],
|
||||
stepsList: json["steps"] != null
|
||||
? (json["steps"] as List).map((v) => PlanStepDto.fromJson(v)).toList()
|
||||
: [],
|
||||
suggestionsList: json["suggestions"] != null
|
||||
? List<String>.from(json["suggestions"])
|
||||
: [],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
"agent_name": agentName,
|
||||
"summary": summary,
|
||||
"dialog": dialog,
|
||||
"steps": stepsList.map((v) => v.toJson()).toList(),
|
||||
"suggestions": suggestionsList,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user