forked from eatvio/eatvio_app
54 lines
1.4 KiB
Dart
54 lines
1.4 KiB
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'consultant_review_model.freezed.dart';
|
|
part 'consultant_review_model.g.dart';
|
|
|
|
@freezed
|
|
abstract class ConsultantReviewModel with _$ConsultantReviewModel {
|
|
|
|
factory ConsultantReviewModel({
|
|
required String planName,
|
|
required int planDuration,
|
|
required int currentPlanDay,
|
|
required ConsultantComments consultantComments,
|
|
}) = _ConsultantReviewModel;
|
|
|
|
factory ConsultantReviewModel.fromJson(Map<String, dynamic> json) => _$ConsultantReviewModelFromJson(json);
|
|
}
|
|
|
|
|
|
@freezed
|
|
abstract class ConsultantComments with _$ConsultantComments {
|
|
|
|
factory ConsultantComments({
|
|
required String? dayComment,
|
|
required List<MealComment> mealsComments,
|
|
required List<PortionComment> portionsComments,
|
|
}) = _ConsultantComments;
|
|
|
|
factory ConsultantComments.fromJson(Map<String, dynamic> json) => _$ConsultantCommentsFromJson(json);
|
|
}
|
|
|
|
|
|
|
|
@freezed
|
|
abstract class MealComment with _$MealComment {
|
|
|
|
factory MealComment({
|
|
required String comment,
|
|
required int typeNo,
|
|
}) = _MealComment;
|
|
|
|
factory MealComment.fromJson(Map<String, dynamic> json) => _$MealCommentFromJson(json);
|
|
}
|
|
|
|
@freezed
|
|
abstract class PortionComment with _$PortionComment {
|
|
|
|
factory PortionComment({
|
|
@JsonKey(name: 'id') required int portionId,
|
|
required String comment,
|
|
}) = _PortionComment;
|
|
|
|
factory PortionComment.fromJson(Map<String, dynamic> json) => _$PortionCommentFromJson(json);
|
|
} |