forked from eatvio/eatvio_app
feat(chat): add consultation progress and personal diet status
related to #1115
This commit is contained in:
@@ -21,6 +21,21 @@ abstract class ChosenPlanModel with _$ChosenPlanModel {
|
||||
factory ChosenPlanModel.fromJson(Map<String, dynamic> json) => _$ChosenPlanModelFromJson(json);
|
||||
}
|
||||
|
||||
extension ChosenPlanModelX on ChosenPlanModel {
|
||||
PacketOptions? get chosenOption {
|
||||
switch (optionType) {
|
||||
case 'options1':
|
||||
return plan.packet1Options;
|
||||
case 'options2':
|
||||
return plan.packet2Options;
|
||||
case 'options3':
|
||||
return plan.packet3Options;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ChosenPlanModel? parseChosenPlan(dynamic json) {
|
||||
if (json is Map<String, dynamic>) {
|
||||
return ChosenPlanModel.fromJson(json);
|
||||
|
||||
Reference in New Issue
Block a user