forked from eatvio/eatvio_app
36 lines
1.1 KiB
Dart
36 lines
1.1 KiB
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'consultant_comment_model.freezed.dart';
|
|
part 'consultant_comment_model.g.dart';
|
|
|
|
@freezed
|
|
abstract class ConsultantCommentModel with _$ConsultantCommentModel {
|
|
factory ConsultantCommentModel({
|
|
String? comment,
|
|
@Default({}) @JsonKey(name: 'meals') Map<String, MealCommentModel> mealsComments,
|
|
@Default([]) List<PortionCommentModel> portions,
|
|
}) = _ConsultantCommentModel;
|
|
|
|
factory ConsultantCommentModel.fromJson(Map<String, dynamic> json) => _$ConsultantCommentModelFromJson(json);
|
|
}
|
|
|
|
@freezed
|
|
abstract class PortionCommentModel with _$PortionCommentModel {
|
|
factory PortionCommentModel({
|
|
required String comment,
|
|
required int id,
|
|
}) = _PortionCommentModel;
|
|
|
|
factory PortionCommentModel.fromJson(Map<String, dynamic> json) => _$PortionCommentModelFromJson(json);
|
|
}
|
|
|
|
@freezed
|
|
abstract class MealCommentModel with _$MealCommentModel {
|
|
|
|
factory MealCommentModel({
|
|
required String comment,
|
|
@JsonKey(name: 'type_no')required int typeNumber
|
|
}) = _MealCommentModel;
|
|
|
|
factory MealCommentModel.fromJson(Map<String, dynamic> json) => _$MealCommentModelFromJson(json);
|
|
} |