forked from eatvio/eatvio_app
feat(diary): consultant comments
This commit is contained in:
36
lib/features/diary/models/consultant_comment_model.dart
Normal file
36
lib/features/diary/models/consultant_comment_model.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'consultant_comment_model.freezed.dart';
|
||||
part 'consultant_comment_model.g.dart';
|
||||
|
||||
@freezed
|
||||
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
|
||||
class PortionCommentModel with _$PortionCommentModel {
|
||||
factory PortionCommentModel({
|
||||
required String comment,
|
||||
required int id,
|
||||
}) = _PortionCommentModel;
|
||||
|
||||
factory PortionCommentModel.fromJson(Map<String, dynamic> json) => _$PortionCommentModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
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);
|
||||
}
|
||||
581
lib/features/diary/models/consultant_comment_model.freezed.dart
Normal file
581
lib/features/diary/models/consultant_comment_model.freezed.dart
Normal file
@@ -0,0 +1,581 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'consultant_comment_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ConsultantCommentModel _$ConsultantCommentModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _ConsultantCommentModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ConsultantCommentModel {
|
||||
String? get comment => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'meals')
|
||||
Map<String, MealCommentModel> get mealsComments =>
|
||||
throw _privateConstructorUsedError;
|
||||
List<PortionCommentModel> get portions => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ConsultantCommentModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ConsultantCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ConsultantCommentModelCopyWith<ConsultantCommentModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ConsultantCommentModelCopyWith<$Res> {
|
||||
factory $ConsultantCommentModelCopyWith(ConsultantCommentModel value,
|
||||
$Res Function(ConsultantCommentModel) then) =
|
||||
_$ConsultantCommentModelCopyWithImpl<$Res, ConsultantCommentModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? comment,
|
||||
@JsonKey(name: 'meals') Map<String, MealCommentModel> mealsComments,
|
||||
List<PortionCommentModel> portions});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ConsultantCommentModelCopyWithImpl<$Res,
|
||||
$Val extends ConsultantCommentModel>
|
||||
implements $ConsultantCommentModelCopyWith<$Res> {
|
||||
_$ConsultantCommentModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ConsultantCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? comment = freezed,
|
||||
Object? mealsComments = null,
|
||||
Object? portions = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
comment: freezed == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
mealsComments: null == mealsComments
|
||||
? _value.mealsComments
|
||||
: mealsComments // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, MealCommentModel>,
|
||||
portions: null == portions
|
||||
? _value.portions
|
||||
: portions // ignore: cast_nullable_to_non_nullable
|
||||
as List<PortionCommentModel>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ConsultantCommentModelImplCopyWith<$Res>
|
||||
implements $ConsultantCommentModelCopyWith<$Res> {
|
||||
factory _$$ConsultantCommentModelImplCopyWith(
|
||||
_$ConsultantCommentModelImpl value,
|
||||
$Res Function(_$ConsultantCommentModelImpl) then) =
|
||||
__$$ConsultantCommentModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? comment,
|
||||
@JsonKey(name: 'meals') Map<String, MealCommentModel> mealsComments,
|
||||
List<PortionCommentModel> portions});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ConsultantCommentModelImplCopyWithImpl<$Res>
|
||||
extends _$ConsultantCommentModelCopyWithImpl<$Res,
|
||||
_$ConsultantCommentModelImpl>
|
||||
implements _$$ConsultantCommentModelImplCopyWith<$Res> {
|
||||
__$$ConsultantCommentModelImplCopyWithImpl(
|
||||
_$ConsultantCommentModelImpl _value,
|
||||
$Res Function(_$ConsultantCommentModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ConsultantCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? comment = freezed,
|
||||
Object? mealsComments = null,
|
||||
Object? portions = null,
|
||||
}) {
|
||||
return _then(_$ConsultantCommentModelImpl(
|
||||
comment: freezed == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
mealsComments: null == mealsComments
|
||||
? _value._mealsComments
|
||||
: mealsComments // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, MealCommentModel>,
|
||||
portions: null == portions
|
||||
? _value._portions
|
||||
: portions // ignore: cast_nullable_to_non_nullable
|
||||
as List<PortionCommentModel>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ConsultantCommentModelImpl implements _ConsultantCommentModel {
|
||||
_$ConsultantCommentModelImpl(
|
||||
{this.comment,
|
||||
@JsonKey(name: 'meals')
|
||||
final Map<String, MealCommentModel> mealsComments = const {},
|
||||
final List<PortionCommentModel> portions = const []})
|
||||
: _mealsComments = mealsComments,
|
||||
_portions = portions;
|
||||
|
||||
factory _$ConsultantCommentModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ConsultantCommentModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String? comment;
|
||||
final Map<String, MealCommentModel> _mealsComments;
|
||||
@override
|
||||
@JsonKey(name: 'meals')
|
||||
Map<String, MealCommentModel> get mealsComments {
|
||||
if (_mealsComments is EqualUnmodifiableMapView) return _mealsComments;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableMapView(_mealsComments);
|
||||
}
|
||||
|
||||
final List<PortionCommentModel> _portions;
|
||||
@override
|
||||
@JsonKey()
|
||||
List<PortionCommentModel> get portions {
|
||||
if (_portions is EqualUnmodifiableListView) return _portions;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_portions);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ConsultantCommentModel(comment: $comment, mealsComments: $mealsComments, portions: $portions)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ConsultantCommentModelImpl &&
|
||||
(identical(other.comment, comment) || other.comment == comment) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._mealsComments, _mealsComments) &&
|
||||
const DeepCollectionEquality().equals(other._portions, _portions));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
comment,
|
||||
const DeepCollectionEquality().hash(_mealsComments),
|
||||
const DeepCollectionEquality().hash(_portions));
|
||||
|
||||
/// Create a copy of ConsultantCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ConsultantCommentModelImplCopyWith<_$ConsultantCommentModelImpl>
|
||||
get copyWith => __$$ConsultantCommentModelImplCopyWithImpl<
|
||||
_$ConsultantCommentModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ConsultantCommentModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ConsultantCommentModel implements ConsultantCommentModel {
|
||||
factory _ConsultantCommentModel(
|
||||
{final String? comment,
|
||||
@JsonKey(name: 'meals') final Map<String, MealCommentModel> mealsComments,
|
||||
final List<PortionCommentModel> portions}) = _$ConsultantCommentModelImpl;
|
||||
|
||||
factory _ConsultantCommentModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ConsultantCommentModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String? get comment;
|
||||
@override
|
||||
@JsonKey(name: 'meals')
|
||||
Map<String, MealCommentModel> get mealsComments;
|
||||
@override
|
||||
List<PortionCommentModel> get portions;
|
||||
|
||||
/// Create a copy of ConsultantCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ConsultantCommentModelImplCopyWith<_$ConsultantCommentModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
PortionCommentModel _$PortionCommentModelFromJson(Map<String, dynamic> json) {
|
||||
return _PortionCommentModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$PortionCommentModel {
|
||||
String get comment => throw _privateConstructorUsedError;
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this PortionCommentModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of PortionCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$PortionCommentModelCopyWith<PortionCommentModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $PortionCommentModelCopyWith<$Res> {
|
||||
factory $PortionCommentModelCopyWith(
|
||||
PortionCommentModel value, $Res Function(PortionCommentModel) then) =
|
||||
_$PortionCommentModelCopyWithImpl<$Res, PortionCommentModel>;
|
||||
@useResult
|
||||
$Res call({String comment, int id});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$PortionCommentModelCopyWithImpl<$Res, $Val extends PortionCommentModel>
|
||||
implements $PortionCommentModelCopyWith<$Res> {
|
||||
_$PortionCommentModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of PortionCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? comment = null,
|
||||
Object? id = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
comment: null == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$PortionCommentModelImplCopyWith<$Res>
|
||||
implements $PortionCommentModelCopyWith<$Res> {
|
||||
factory _$$PortionCommentModelImplCopyWith(_$PortionCommentModelImpl value,
|
||||
$Res Function(_$PortionCommentModelImpl) then) =
|
||||
__$$PortionCommentModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String comment, int id});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$PortionCommentModelImplCopyWithImpl<$Res>
|
||||
extends _$PortionCommentModelCopyWithImpl<$Res, _$PortionCommentModelImpl>
|
||||
implements _$$PortionCommentModelImplCopyWith<$Res> {
|
||||
__$$PortionCommentModelImplCopyWithImpl(_$PortionCommentModelImpl _value,
|
||||
$Res Function(_$PortionCommentModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of PortionCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? comment = null,
|
||||
Object? id = null,
|
||||
}) {
|
||||
return _then(_$PortionCommentModelImpl(
|
||||
comment: null == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$PortionCommentModelImpl implements _PortionCommentModel {
|
||||
_$PortionCommentModelImpl({required this.comment, required this.id});
|
||||
|
||||
factory _$PortionCommentModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$PortionCommentModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String comment;
|
||||
@override
|
||||
final int id;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PortionCommentModel(comment: $comment, id: $id)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$PortionCommentModelImpl &&
|
||||
(identical(other.comment, comment) || other.comment == comment) &&
|
||||
(identical(other.id, id) || other.id == id));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, comment, id);
|
||||
|
||||
/// Create a copy of PortionCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$PortionCommentModelImplCopyWith<_$PortionCommentModelImpl> get copyWith =>
|
||||
__$$PortionCommentModelImplCopyWithImpl<_$PortionCommentModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$PortionCommentModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _PortionCommentModel implements PortionCommentModel {
|
||||
factory _PortionCommentModel(
|
||||
{required final String comment,
|
||||
required final int id}) = _$PortionCommentModelImpl;
|
||||
|
||||
factory _PortionCommentModel.fromJson(Map<String, dynamic> json) =
|
||||
_$PortionCommentModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get comment;
|
||||
@override
|
||||
int get id;
|
||||
|
||||
/// Create a copy of PortionCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$PortionCommentModelImplCopyWith<_$PortionCommentModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
MealCommentModel _$MealCommentModelFromJson(Map<String, dynamic> json) {
|
||||
return _MealCommentModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$MealCommentModel {
|
||||
String get comment => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'type_no')
|
||||
int get typeNumber => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this MealCommentModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of MealCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$MealCommentModelCopyWith<MealCommentModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $MealCommentModelCopyWith<$Res> {
|
||||
factory $MealCommentModelCopyWith(
|
||||
MealCommentModel value, $Res Function(MealCommentModel) then) =
|
||||
_$MealCommentModelCopyWithImpl<$Res, MealCommentModel>;
|
||||
@useResult
|
||||
$Res call({String comment, @JsonKey(name: 'type_no') int typeNumber});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$MealCommentModelCopyWithImpl<$Res, $Val extends MealCommentModel>
|
||||
implements $MealCommentModelCopyWith<$Res> {
|
||||
_$MealCommentModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of MealCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? comment = null,
|
||||
Object? typeNumber = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
comment: null == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
typeNumber: null == typeNumber
|
||||
? _value.typeNumber
|
||||
: typeNumber // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$MealCommentModelImplCopyWith<$Res>
|
||||
implements $MealCommentModelCopyWith<$Res> {
|
||||
factory _$$MealCommentModelImplCopyWith(_$MealCommentModelImpl value,
|
||||
$Res Function(_$MealCommentModelImpl) then) =
|
||||
__$$MealCommentModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String comment, @JsonKey(name: 'type_no') int typeNumber});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$MealCommentModelImplCopyWithImpl<$Res>
|
||||
extends _$MealCommentModelCopyWithImpl<$Res, _$MealCommentModelImpl>
|
||||
implements _$$MealCommentModelImplCopyWith<$Res> {
|
||||
__$$MealCommentModelImplCopyWithImpl(_$MealCommentModelImpl _value,
|
||||
$Res Function(_$MealCommentModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of MealCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? comment = null,
|
||||
Object? typeNumber = null,
|
||||
}) {
|
||||
return _then(_$MealCommentModelImpl(
|
||||
comment: null == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
typeNumber: null == typeNumber
|
||||
? _value.typeNumber
|
||||
: typeNumber // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$MealCommentModelImpl implements _MealCommentModel {
|
||||
_$MealCommentModelImpl(
|
||||
{required this.comment,
|
||||
@JsonKey(name: 'type_no') required this.typeNumber});
|
||||
|
||||
factory _$MealCommentModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$MealCommentModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String comment;
|
||||
@override
|
||||
@JsonKey(name: 'type_no')
|
||||
final int typeNumber;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MealCommentModel(comment: $comment, typeNumber: $typeNumber)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$MealCommentModelImpl &&
|
||||
(identical(other.comment, comment) || other.comment == comment) &&
|
||||
(identical(other.typeNumber, typeNumber) ||
|
||||
other.typeNumber == typeNumber));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, comment, typeNumber);
|
||||
|
||||
/// Create a copy of MealCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$MealCommentModelImplCopyWith<_$MealCommentModelImpl> get copyWith =>
|
||||
__$$MealCommentModelImplCopyWithImpl<_$MealCommentModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$MealCommentModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _MealCommentModel implements MealCommentModel {
|
||||
factory _MealCommentModel(
|
||||
{required final String comment,
|
||||
@JsonKey(name: 'type_no') required final int typeNumber}) =
|
||||
_$MealCommentModelImpl;
|
||||
|
||||
factory _MealCommentModel.fromJson(Map<String, dynamic> json) =
|
||||
_$MealCommentModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get comment;
|
||||
@override
|
||||
@JsonKey(name: 'type_no')
|
||||
int get typeNumber;
|
||||
|
||||
/// Create a copy of MealCommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$MealCommentModelImplCopyWith<_$MealCommentModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
59
lib/features/diary/models/consultant_comment_model.g.dart
Normal file
59
lib/features/diary/models/consultant_comment_model.g.dart
Normal file
@@ -0,0 +1,59 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'consultant_comment_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ConsultantCommentModelImpl _$$ConsultantCommentModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ConsultantCommentModelImpl(
|
||||
comment: json['comment'] as String?,
|
||||
mealsComments: (json['meals'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(
|
||||
k, MealCommentModel.fromJson(e as Map<String, dynamic>)),
|
||||
) ??
|
||||
const {},
|
||||
portions: (json['portions'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
PortionCommentModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ConsultantCommentModelImplToJson(
|
||||
_$ConsultantCommentModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'comment': instance.comment,
|
||||
'meals': instance.mealsComments,
|
||||
'portions': instance.portions,
|
||||
};
|
||||
|
||||
_$PortionCommentModelImpl _$$PortionCommentModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$PortionCommentModelImpl(
|
||||
comment: json['comment'] as String,
|
||||
id: (json['id'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$PortionCommentModelImplToJson(
|
||||
_$PortionCommentModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'comment': instance.comment,
|
||||
'id': instance.id,
|
||||
};
|
||||
|
||||
_$MealCommentModelImpl _$$MealCommentModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MealCommentModelImpl(
|
||||
comment: json['comment'] as String,
|
||||
typeNumber: (json['type_no'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MealCommentModelImplToJson(
|
||||
_$MealCommentModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'comment': instance.comment,
|
||||
'type_no': instance.typeNumber,
|
||||
};
|
||||
53
lib/features/diary/models/consultant_review_model.dart
Normal file
53
lib/features/diary/models/consultant_review_model.dart
Normal file
@@ -0,0 +1,53 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'consultant_review_model.freezed.dart';
|
||||
part 'consultant_review_model.g.dart';
|
||||
|
||||
@freezed
|
||||
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
|
||||
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
|
||||
class MealComment with _$MealComment {
|
||||
|
||||
factory MealComment({
|
||||
required String comment,
|
||||
}) = _MealComment;
|
||||
|
||||
factory MealComment.fromJson(Map<String, dynamic> json) => _$MealCommentFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class PortionComment with _$PortionComment {
|
||||
|
||||
factory PortionComment({
|
||||
@JsonKey(name: 'commentable_id') required int portionId,
|
||||
required String comment,
|
||||
}) = _PortionComment;
|
||||
|
||||
factory PortionComment.fromJson(Map<String, dynamic> json) => _$PortionCommentFromJson(json);
|
||||
}
|
||||
796
lib/features/diary/models/consultant_review_model.freezed.dart
Normal file
796
lib/features/diary/models/consultant_review_model.freezed.dart
Normal file
@@ -0,0 +1,796 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'consultant_review_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ConsultantReviewModel _$ConsultantReviewModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _ConsultantReviewModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ConsultantReviewModel {
|
||||
String get planName => throw _privateConstructorUsedError;
|
||||
int get planDuration => throw _privateConstructorUsedError;
|
||||
int get currentPlanDay => throw _privateConstructorUsedError;
|
||||
ConsultantComments get consultantComments =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ConsultantReviewModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ConsultantReviewModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ConsultantReviewModelCopyWith<ConsultantReviewModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ConsultantReviewModelCopyWith<$Res> {
|
||||
factory $ConsultantReviewModelCopyWith(ConsultantReviewModel value,
|
||||
$Res Function(ConsultantReviewModel) then) =
|
||||
_$ConsultantReviewModelCopyWithImpl<$Res, ConsultantReviewModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String planName,
|
||||
int planDuration,
|
||||
int currentPlanDay,
|
||||
ConsultantComments consultantComments});
|
||||
|
||||
$ConsultantCommentsCopyWith<$Res> get consultantComments;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ConsultantReviewModelCopyWithImpl<$Res,
|
||||
$Val extends ConsultantReviewModel>
|
||||
implements $ConsultantReviewModelCopyWith<$Res> {
|
||||
_$ConsultantReviewModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ConsultantReviewModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? planName = null,
|
||||
Object? planDuration = null,
|
||||
Object? currentPlanDay = null,
|
||||
Object? consultantComments = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
planName: null == planName
|
||||
? _value.planName
|
||||
: planName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
planDuration: null == planDuration
|
||||
? _value.planDuration
|
||||
: planDuration // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
currentPlanDay: null == currentPlanDay
|
||||
? _value.currentPlanDay
|
||||
: currentPlanDay // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
consultantComments: null == consultantComments
|
||||
? _value.consultantComments
|
||||
: consultantComments // ignore: cast_nullable_to_non_nullable
|
||||
as ConsultantComments,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of ConsultantReviewModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ConsultantCommentsCopyWith<$Res> get consultantComments {
|
||||
return $ConsultantCommentsCopyWith<$Res>(_value.consultantComments,
|
||||
(value) {
|
||||
return _then(_value.copyWith(consultantComments: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ConsultantReviewModelImplCopyWith<$Res>
|
||||
implements $ConsultantReviewModelCopyWith<$Res> {
|
||||
factory _$$ConsultantReviewModelImplCopyWith(
|
||||
_$ConsultantReviewModelImpl value,
|
||||
$Res Function(_$ConsultantReviewModelImpl) then) =
|
||||
__$$ConsultantReviewModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String planName,
|
||||
int planDuration,
|
||||
int currentPlanDay,
|
||||
ConsultantComments consultantComments});
|
||||
|
||||
@override
|
||||
$ConsultantCommentsCopyWith<$Res> get consultantComments;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ConsultantReviewModelImplCopyWithImpl<$Res>
|
||||
extends _$ConsultantReviewModelCopyWithImpl<$Res,
|
||||
_$ConsultantReviewModelImpl>
|
||||
implements _$$ConsultantReviewModelImplCopyWith<$Res> {
|
||||
__$$ConsultantReviewModelImplCopyWithImpl(_$ConsultantReviewModelImpl _value,
|
||||
$Res Function(_$ConsultantReviewModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ConsultantReviewModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? planName = null,
|
||||
Object? planDuration = null,
|
||||
Object? currentPlanDay = null,
|
||||
Object? consultantComments = null,
|
||||
}) {
|
||||
return _then(_$ConsultantReviewModelImpl(
|
||||
planName: null == planName
|
||||
? _value.planName
|
||||
: planName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
planDuration: null == planDuration
|
||||
? _value.planDuration
|
||||
: planDuration // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
currentPlanDay: null == currentPlanDay
|
||||
? _value.currentPlanDay
|
||||
: currentPlanDay // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
consultantComments: null == consultantComments
|
||||
? _value.consultantComments
|
||||
: consultantComments // ignore: cast_nullable_to_non_nullable
|
||||
as ConsultantComments,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ConsultantReviewModelImpl implements _ConsultantReviewModel {
|
||||
_$ConsultantReviewModelImpl(
|
||||
{required this.planName,
|
||||
required this.planDuration,
|
||||
required this.currentPlanDay,
|
||||
required this.consultantComments});
|
||||
|
||||
factory _$ConsultantReviewModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ConsultantReviewModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String planName;
|
||||
@override
|
||||
final int planDuration;
|
||||
@override
|
||||
final int currentPlanDay;
|
||||
@override
|
||||
final ConsultantComments consultantComments;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ConsultantReviewModel(planName: $planName, planDuration: $planDuration, currentPlanDay: $currentPlanDay, consultantComments: $consultantComments)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ConsultantReviewModelImpl &&
|
||||
(identical(other.planName, planName) ||
|
||||
other.planName == planName) &&
|
||||
(identical(other.planDuration, planDuration) ||
|
||||
other.planDuration == planDuration) &&
|
||||
(identical(other.currentPlanDay, currentPlanDay) ||
|
||||
other.currentPlanDay == currentPlanDay) &&
|
||||
(identical(other.consultantComments, consultantComments) ||
|
||||
other.consultantComments == consultantComments));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, planName, planDuration, currentPlanDay, consultantComments);
|
||||
|
||||
/// Create a copy of ConsultantReviewModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ConsultantReviewModelImplCopyWith<_$ConsultantReviewModelImpl>
|
||||
get copyWith => __$$ConsultantReviewModelImplCopyWithImpl<
|
||||
_$ConsultantReviewModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ConsultantReviewModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ConsultantReviewModel implements ConsultantReviewModel {
|
||||
factory _ConsultantReviewModel(
|
||||
{required final String planName,
|
||||
required final int planDuration,
|
||||
required final int currentPlanDay,
|
||||
required final ConsultantComments consultantComments}) =
|
||||
_$ConsultantReviewModelImpl;
|
||||
|
||||
factory _ConsultantReviewModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ConsultantReviewModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get planName;
|
||||
@override
|
||||
int get planDuration;
|
||||
@override
|
||||
int get currentPlanDay;
|
||||
@override
|
||||
ConsultantComments get consultantComments;
|
||||
|
||||
/// Create a copy of ConsultantReviewModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ConsultantReviewModelImplCopyWith<_$ConsultantReviewModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
ConsultantComments _$ConsultantCommentsFromJson(Map<String, dynamic> json) {
|
||||
return _ConsultantComments.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ConsultantComments {
|
||||
String? get dayComment => throw _privateConstructorUsedError;
|
||||
List<MealComment> get mealsComments => throw _privateConstructorUsedError;
|
||||
List<PortionComment> get portionsComments =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ConsultantComments to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ConsultantComments
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ConsultantCommentsCopyWith<ConsultantComments> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ConsultantCommentsCopyWith<$Res> {
|
||||
factory $ConsultantCommentsCopyWith(
|
||||
ConsultantComments value, $Res Function(ConsultantComments) then) =
|
||||
_$ConsultantCommentsCopyWithImpl<$Res, ConsultantComments>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? dayComment,
|
||||
List<MealComment> mealsComments,
|
||||
List<PortionComment> portionsComments});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ConsultantCommentsCopyWithImpl<$Res, $Val extends ConsultantComments>
|
||||
implements $ConsultantCommentsCopyWith<$Res> {
|
||||
_$ConsultantCommentsCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ConsultantComments
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? dayComment = freezed,
|
||||
Object? mealsComments = null,
|
||||
Object? portionsComments = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
dayComment: freezed == dayComment
|
||||
? _value.dayComment
|
||||
: dayComment // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
mealsComments: null == mealsComments
|
||||
? _value.mealsComments
|
||||
: mealsComments // ignore: cast_nullable_to_non_nullable
|
||||
as List<MealComment>,
|
||||
portionsComments: null == portionsComments
|
||||
? _value.portionsComments
|
||||
: portionsComments // ignore: cast_nullable_to_non_nullable
|
||||
as List<PortionComment>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ConsultantCommentsImplCopyWith<$Res>
|
||||
implements $ConsultantCommentsCopyWith<$Res> {
|
||||
factory _$$ConsultantCommentsImplCopyWith(_$ConsultantCommentsImpl value,
|
||||
$Res Function(_$ConsultantCommentsImpl) then) =
|
||||
__$$ConsultantCommentsImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? dayComment,
|
||||
List<MealComment> mealsComments,
|
||||
List<PortionComment> portionsComments});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ConsultantCommentsImplCopyWithImpl<$Res>
|
||||
extends _$ConsultantCommentsCopyWithImpl<$Res, _$ConsultantCommentsImpl>
|
||||
implements _$$ConsultantCommentsImplCopyWith<$Res> {
|
||||
__$$ConsultantCommentsImplCopyWithImpl(_$ConsultantCommentsImpl _value,
|
||||
$Res Function(_$ConsultantCommentsImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ConsultantComments
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? dayComment = freezed,
|
||||
Object? mealsComments = null,
|
||||
Object? portionsComments = null,
|
||||
}) {
|
||||
return _then(_$ConsultantCommentsImpl(
|
||||
dayComment: freezed == dayComment
|
||||
? _value.dayComment
|
||||
: dayComment // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
mealsComments: null == mealsComments
|
||||
? _value._mealsComments
|
||||
: mealsComments // ignore: cast_nullable_to_non_nullable
|
||||
as List<MealComment>,
|
||||
portionsComments: null == portionsComments
|
||||
? _value._portionsComments
|
||||
: portionsComments // ignore: cast_nullable_to_non_nullable
|
||||
as List<PortionComment>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ConsultantCommentsImpl implements _ConsultantComments {
|
||||
_$ConsultantCommentsImpl(
|
||||
{required this.dayComment,
|
||||
required final List<MealComment> mealsComments,
|
||||
required final List<PortionComment> portionsComments})
|
||||
: _mealsComments = mealsComments,
|
||||
_portionsComments = portionsComments;
|
||||
|
||||
factory _$ConsultantCommentsImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ConsultantCommentsImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String? dayComment;
|
||||
final List<MealComment> _mealsComments;
|
||||
@override
|
||||
List<MealComment> get mealsComments {
|
||||
if (_mealsComments is EqualUnmodifiableListView) return _mealsComments;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_mealsComments);
|
||||
}
|
||||
|
||||
final List<PortionComment> _portionsComments;
|
||||
@override
|
||||
List<PortionComment> get portionsComments {
|
||||
if (_portionsComments is EqualUnmodifiableListView)
|
||||
return _portionsComments;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_portionsComments);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ConsultantComments(dayComment: $dayComment, mealsComments: $mealsComments, portionsComments: $portionsComments)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ConsultantCommentsImpl &&
|
||||
(identical(other.dayComment, dayComment) ||
|
||||
other.dayComment == dayComment) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._mealsComments, _mealsComments) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._portionsComments, _portionsComments));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
dayComment,
|
||||
const DeepCollectionEquality().hash(_mealsComments),
|
||||
const DeepCollectionEquality().hash(_portionsComments));
|
||||
|
||||
/// Create a copy of ConsultantComments
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ConsultantCommentsImplCopyWith<_$ConsultantCommentsImpl> get copyWith =>
|
||||
__$$ConsultantCommentsImplCopyWithImpl<_$ConsultantCommentsImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ConsultantCommentsImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ConsultantComments implements ConsultantComments {
|
||||
factory _ConsultantComments(
|
||||
{required final String? dayComment,
|
||||
required final List<MealComment> mealsComments,
|
||||
required final List<PortionComment> portionsComments}) =
|
||||
_$ConsultantCommentsImpl;
|
||||
|
||||
factory _ConsultantComments.fromJson(Map<String, dynamic> json) =
|
||||
_$ConsultantCommentsImpl.fromJson;
|
||||
|
||||
@override
|
||||
String? get dayComment;
|
||||
@override
|
||||
List<MealComment> get mealsComments;
|
||||
@override
|
||||
List<PortionComment> get portionsComments;
|
||||
|
||||
/// Create a copy of ConsultantComments
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ConsultantCommentsImplCopyWith<_$ConsultantCommentsImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
MealComment _$MealCommentFromJson(Map<String, dynamic> json) {
|
||||
return _MealComment.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$MealComment {
|
||||
String get comment => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this MealComment to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of MealComment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$MealCommentCopyWith<MealComment> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $MealCommentCopyWith<$Res> {
|
||||
factory $MealCommentCopyWith(
|
||||
MealComment value, $Res Function(MealComment) then) =
|
||||
_$MealCommentCopyWithImpl<$Res, MealComment>;
|
||||
@useResult
|
||||
$Res call({String comment});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$MealCommentCopyWithImpl<$Res, $Val extends MealComment>
|
||||
implements $MealCommentCopyWith<$Res> {
|
||||
_$MealCommentCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of MealComment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? comment = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
comment: null == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$MealCommentImplCopyWith<$Res>
|
||||
implements $MealCommentCopyWith<$Res> {
|
||||
factory _$$MealCommentImplCopyWith(
|
||||
_$MealCommentImpl value, $Res Function(_$MealCommentImpl) then) =
|
||||
__$$MealCommentImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String comment});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$MealCommentImplCopyWithImpl<$Res>
|
||||
extends _$MealCommentCopyWithImpl<$Res, _$MealCommentImpl>
|
||||
implements _$$MealCommentImplCopyWith<$Res> {
|
||||
__$$MealCommentImplCopyWithImpl(
|
||||
_$MealCommentImpl _value, $Res Function(_$MealCommentImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of MealComment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? comment = null,
|
||||
}) {
|
||||
return _then(_$MealCommentImpl(
|
||||
comment: null == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$MealCommentImpl implements _MealComment {
|
||||
_$MealCommentImpl({required this.comment});
|
||||
|
||||
factory _$MealCommentImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$MealCommentImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String comment;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MealComment(comment: $comment)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$MealCommentImpl &&
|
||||
(identical(other.comment, comment) || other.comment == comment));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, comment);
|
||||
|
||||
/// Create a copy of MealComment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$MealCommentImplCopyWith<_$MealCommentImpl> get copyWith =>
|
||||
__$$MealCommentImplCopyWithImpl<_$MealCommentImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$MealCommentImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _MealComment implements MealComment {
|
||||
factory _MealComment({required final String comment}) = _$MealCommentImpl;
|
||||
|
||||
factory _MealComment.fromJson(Map<String, dynamic> json) =
|
||||
_$MealCommentImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get comment;
|
||||
|
||||
/// Create a copy of MealComment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$MealCommentImplCopyWith<_$MealCommentImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
PortionComment _$PortionCommentFromJson(Map<String, dynamic> json) {
|
||||
return _PortionComment.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$PortionComment {
|
||||
@JsonKey(name: 'commentable_id')
|
||||
int get portionId => throw _privateConstructorUsedError;
|
||||
String get comment => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this PortionComment to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of PortionComment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$PortionCommentCopyWith<PortionComment> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $PortionCommentCopyWith<$Res> {
|
||||
factory $PortionCommentCopyWith(
|
||||
PortionComment value, $Res Function(PortionComment) then) =
|
||||
_$PortionCommentCopyWithImpl<$Res, PortionComment>;
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'commentable_id') int portionId, String comment});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$PortionCommentCopyWithImpl<$Res, $Val extends PortionComment>
|
||||
implements $PortionCommentCopyWith<$Res> {
|
||||
_$PortionCommentCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of PortionComment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? portionId = null,
|
||||
Object? comment = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
portionId: null == portionId
|
||||
? _value.portionId
|
||||
: portionId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
comment: null == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$PortionCommentImplCopyWith<$Res>
|
||||
implements $PortionCommentCopyWith<$Res> {
|
||||
factory _$$PortionCommentImplCopyWith(_$PortionCommentImpl value,
|
||||
$Res Function(_$PortionCommentImpl) then) =
|
||||
__$$PortionCommentImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'commentable_id') int portionId, String comment});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$PortionCommentImplCopyWithImpl<$Res>
|
||||
extends _$PortionCommentCopyWithImpl<$Res, _$PortionCommentImpl>
|
||||
implements _$$PortionCommentImplCopyWith<$Res> {
|
||||
__$$PortionCommentImplCopyWithImpl(
|
||||
_$PortionCommentImpl _value, $Res Function(_$PortionCommentImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of PortionComment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? portionId = null,
|
||||
Object? comment = null,
|
||||
}) {
|
||||
return _then(_$PortionCommentImpl(
|
||||
portionId: null == portionId
|
||||
? _value.portionId
|
||||
: portionId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
comment: null == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$PortionCommentImpl implements _PortionComment {
|
||||
_$PortionCommentImpl(
|
||||
{@JsonKey(name: 'commentable_id') required this.portionId,
|
||||
required this.comment});
|
||||
|
||||
factory _$PortionCommentImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$PortionCommentImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'commentable_id')
|
||||
final int portionId;
|
||||
@override
|
||||
final String comment;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PortionComment(portionId: $portionId, comment: $comment)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$PortionCommentImpl &&
|
||||
(identical(other.portionId, portionId) ||
|
||||
other.portionId == portionId) &&
|
||||
(identical(other.comment, comment) || other.comment == comment));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, portionId, comment);
|
||||
|
||||
/// Create a copy of PortionComment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$PortionCommentImplCopyWith<_$PortionCommentImpl> get copyWith =>
|
||||
__$$PortionCommentImplCopyWithImpl<_$PortionCommentImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$PortionCommentImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _PortionComment implements PortionComment {
|
||||
factory _PortionComment(
|
||||
{@JsonKey(name: 'commentable_id') required final int portionId,
|
||||
required final String comment}) = _$PortionCommentImpl;
|
||||
|
||||
factory _PortionComment.fromJson(Map<String, dynamic> json) =
|
||||
_$PortionCommentImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'commentable_id')
|
||||
int get portionId;
|
||||
@override
|
||||
String get comment;
|
||||
|
||||
/// Create a copy of PortionComment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$PortionCommentImplCopyWith<_$PortionCommentImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
69
lib/features/diary/models/consultant_review_model.g.dart
Normal file
69
lib/features/diary/models/consultant_review_model.g.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'consultant_review_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ConsultantReviewModelImpl _$$ConsultantReviewModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ConsultantReviewModelImpl(
|
||||
planName: json['planName'] as String,
|
||||
planDuration: (json['planDuration'] as num).toInt(),
|
||||
currentPlanDay: (json['currentPlanDay'] as num).toInt(),
|
||||
consultantComments: ConsultantComments.fromJson(
|
||||
json['consultantComments'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ConsultantReviewModelImplToJson(
|
||||
_$ConsultantReviewModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'planName': instance.planName,
|
||||
'planDuration': instance.planDuration,
|
||||
'currentPlanDay': instance.currentPlanDay,
|
||||
'consultantComments': instance.consultantComments,
|
||||
};
|
||||
|
||||
_$ConsultantCommentsImpl _$$ConsultantCommentsImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ConsultantCommentsImpl(
|
||||
dayComment: json['dayComment'] as String?,
|
||||
mealsComments: (json['mealsComments'] as List<dynamic>)
|
||||
.map((e) => MealComment.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
portionsComments: (json['portionsComments'] as List<dynamic>)
|
||||
.map((e) => PortionComment.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ConsultantCommentsImplToJson(
|
||||
_$ConsultantCommentsImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'dayComment': instance.dayComment,
|
||||
'mealsComments': instance.mealsComments,
|
||||
'portionsComments': instance.portionsComments,
|
||||
};
|
||||
|
||||
_$MealCommentImpl _$$MealCommentImplFromJson(Map<String, dynamic> json) =>
|
||||
_$MealCommentImpl(
|
||||
comment: json['comment'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MealCommentImplToJson(_$MealCommentImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'comment': instance.comment,
|
||||
};
|
||||
|
||||
_$PortionCommentImpl _$$PortionCommentImplFromJson(Map<String, dynamic> json) =>
|
||||
_$PortionCommentImpl(
|
||||
portionId: (json['commentable_id'] as num).toInt(),
|
||||
comment: json['comment'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$PortionCommentImplToJson(
|
||||
_$PortionCommentImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'commentable_id': instance.portionId,
|
||||
'comment': instance.comment,
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:eatvio_app/features/consultations/models/consultation_model.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'diary_day_model.freezed.dart';
|
||||
@@ -39,6 +40,7 @@ class DiaryDayModel with _$DiaryDayModel {
|
||||
@JsonKey(name: "comment") required String comment,
|
||||
@JsonKey(name: "state") required TypeOfDiaryModel typeOfDiary,
|
||||
@JsonKey(name: "meals") required List<MealModel> meals,
|
||||
@JsonKey(name: "chosen_plan_id") required int? chosenPlanId,
|
||||
}) = _DiaryDayModel;
|
||||
|
||||
factory DiaryDayModel.fromJson(Map<String, dynamic> json) => _$DiaryDayModelFromJson(json);
|
||||
@@ -91,6 +93,7 @@ class TypeOfDiaryModel with _$TypeOfDiaryModel {
|
||||
const factory TypeOfDiaryModel({
|
||||
@JsonKey(name: "has_chosen_diet") required bool hasChosenDiet,
|
||||
@JsonKey(name: "has_chosen_plan") required bool hasChosenPlan,
|
||||
@JsonKey(name: "last_state") required DiaryStateEnum diaryState,
|
||||
}) = _TypeOfDiaryModel;
|
||||
|
||||
factory TypeOfDiaryModel.fromJson(Map<String, dynamic> json) => _$TypeOfDiaryModelFromJson(json);
|
||||
|
||||
@@ -209,6 +209,8 @@ mixin _$DiaryDayModel {
|
||||
TypeOfDiaryModel get typeOfDiary => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "meals")
|
||||
List<MealModel> get meals => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "chosen_plan_id")
|
||||
int? get chosenPlanId => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this DiaryDayModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -234,7 +236,8 @@ abstract class $DiaryDayModelCopyWith<$Res> {
|
||||
@JsonKey(name: "closed") int closed,
|
||||
@JsonKey(name: "comment") String comment,
|
||||
@JsonKey(name: "state") TypeOfDiaryModel typeOfDiary,
|
||||
@JsonKey(name: "meals") List<MealModel> meals});
|
||||
@JsonKey(name: "meals") List<MealModel> meals,
|
||||
@JsonKey(name: "chosen_plan_id") int? chosenPlanId});
|
||||
|
||||
$TypeOfDiaryModelCopyWith<$Res> get typeOfDiary;
|
||||
}
|
||||
@@ -262,6 +265,7 @@ class _$DiaryDayModelCopyWithImpl<$Res, $Val extends DiaryDayModel>
|
||||
Object? comment = null,
|
||||
Object? typeOfDiary = null,
|
||||
Object? meals = null,
|
||||
Object? chosenPlanId = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
@@ -296,6 +300,10 @@ class _$DiaryDayModelCopyWithImpl<$Res, $Val extends DiaryDayModel>
|
||||
? _value.meals
|
||||
: meals // ignore: cast_nullable_to_non_nullable
|
||||
as List<MealModel>,
|
||||
chosenPlanId: freezed == chosenPlanId
|
||||
? _value.chosenPlanId
|
||||
: chosenPlanId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
@@ -326,7 +334,8 @@ abstract class _$$DiaryDayModelImplCopyWith<$Res>
|
||||
@JsonKey(name: "closed") int closed,
|
||||
@JsonKey(name: "comment") String comment,
|
||||
@JsonKey(name: "state") TypeOfDiaryModel typeOfDiary,
|
||||
@JsonKey(name: "meals") List<MealModel> meals});
|
||||
@JsonKey(name: "meals") List<MealModel> meals,
|
||||
@JsonKey(name: "chosen_plan_id") int? chosenPlanId});
|
||||
|
||||
@override
|
||||
$TypeOfDiaryModelCopyWith<$Res> get typeOfDiary;
|
||||
@@ -353,6 +362,7 @@ class __$$DiaryDayModelImplCopyWithImpl<$Res>
|
||||
Object? comment = null,
|
||||
Object? typeOfDiary = null,
|
||||
Object? meals = null,
|
||||
Object? chosenPlanId = freezed,
|
||||
}) {
|
||||
return _then(_$DiaryDayModelImpl(
|
||||
id: null == id
|
||||
@@ -387,6 +397,10 @@ class __$$DiaryDayModelImplCopyWithImpl<$Res>
|
||||
? _value._meals
|
||||
: meals // ignore: cast_nullable_to_non_nullable
|
||||
as List<MealModel>,
|
||||
chosenPlanId: freezed == chosenPlanId
|
||||
? _value.chosenPlanId
|
||||
: chosenPlanId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -402,7 +416,8 @@ class _$DiaryDayModelImpl implements _DiaryDayModel {
|
||||
@JsonKey(name: "closed") required this.closed,
|
||||
@JsonKey(name: "comment") required this.comment,
|
||||
@JsonKey(name: "state") required this.typeOfDiary,
|
||||
@JsonKey(name: "meals") required final List<MealModel> meals})
|
||||
@JsonKey(name: "meals") required final List<MealModel> meals,
|
||||
@JsonKey(name: "chosen_plan_id") required this.chosenPlanId})
|
||||
: _meals = meals;
|
||||
|
||||
factory _$DiaryDayModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -438,9 +453,13 @@ class _$DiaryDayModelImpl implements _DiaryDayModel {
|
||||
return EqualUnmodifiableListView(_meals);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: "chosen_plan_id")
|
||||
final int? chosenPlanId;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryDayModel(id: $id, date: $date, wakeup: $wakeup, retire: $retire, closed: $closed, comment: $comment, typeOfDiary: $typeOfDiary, meals: $meals)';
|
||||
return 'DiaryDayModel(id: $id, date: $date, wakeup: $wakeup, retire: $retire, closed: $closed, comment: $comment, typeOfDiary: $typeOfDiary, meals: $meals, chosenPlanId: $chosenPlanId)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -456,13 +475,24 @@ class _$DiaryDayModelImpl implements _DiaryDayModel {
|
||||
(identical(other.comment, comment) || other.comment == comment) &&
|
||||
(identical(other.typeOfDiary, typeOfDiary) ||
|
||||
other.typeOfDiary == typeOfDiary) &&
|
||||
const DeepCollectionEquality().equals(other._meals, _meals));
|
||||
const DeepCollectionEquality().equals(other._meals, _meals) &&
|
||||
(identical(other.chosenPlanId, chosenPlanId) ||
|
||||
other.chosenPlanId == chosenPlanId));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, date, wakeup, retire, closed,
|
||||
comment, typeOfDiary, const DeepCollectionEquality().hash(_meals));
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
date,
|
||||
wakeup,
|
||||
retire,
|
||||
closed,
|
||||
comment,
|
||||
typeOfDiary,
|
||||
const DeepCollectionEquality().hash(_meals),
|
||||
chosenPlanId);
|
||||
|
||||
/// Create a copy of DiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -489,7 +519,8 @@ abstract class _DiaryDayModel implements DiaryDayModel {
|
||||
@JsonKey(name: "closed") required final int closed,
|
||||
@JsonKey(name: "comment") required final String comment,
|
||||
@JsonKey(name: "state") required final TypeOfDiaryModel typeOfDiary,
|
||||
@JsonKey(name: "meals") required final List<MealModel> meals}) =
|
||||
@JsonKey(name: "meals") required final List<MealModel> meals,
|
||||
@JsonKey(name: "chosen_plan_id") required final int? chosenPlanId}) =
|
||||
_$DiaryDayModelImpl;
|
||||
|
||||
factory _DiaryDayModel.fromJson(Map<String, dynamic> json) =
|
||||
@@ -519,6 +550,9 @@ abstract class _DiaryDayModel implements DiaryDayModel {
|
||||
@override
|
||||
@JsonKey(name: "meals")
|
||||
List<MealModel> get meals;
|
||||
@override
|
||||
@JsonKey(name: "chosen_plan_id")
|
||||
int? get chosenPlanId;
|
||||
|
||||
/// Create a copy of DiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -1387,6 +1421,8 @@ mixin _$TypeOfDiaryModel {
|
||||
bool get hasChosenDiet => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "has_chosen_plan")
|
||||
bool get hasChosenPlan => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "last_state")
|
||||
DiaryStateEnum get diaryState => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this TypeOfDiaryModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -1406,7 +1442,8 @@ abstract class $TypeOfDiaryModelCopyWith<$Res> {
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "has_chosen_diet") bool hasChosenDiet,
|
||||
@JsonKey(name: "has_chosen_plan") bool hasChosenPlan});
|
||||
@JsonKey(name: "has_chosen_plan") bool hasChosenPlan,
|
||||
@JsonKey(name: "last_state") DiaryStateEnum diaryState});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1426,6 +1463,7 @@ class _$TypeOfDiaryModelCopyWithImpl<$Res, $Val extends TypeOfDiaryModel>
|
||||
$Res call({
|
||||
Object? hasChosenDiet = null,
|
||||
Object? hasChosenPlan = null,
|
||||
Object? diaryState = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
hasChosenDiet: null == hasChosenDiet
|
||||
@@ -1436,6 +1474,10 @@ class _$TypeOfDiaryModelCopyWithImpl<$Res, $Val extends TypeOfDiaryModel>
|
||||
? _value.hasChosenPlan
|
||||
: hasChosenPlan // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
diaryState: null == diaryState
|
||||
? _value.diaryState
|
||||
: diaryState // ignore: cast_nullable_to_non_nullable
|
||||
as DiaryStateEnum,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -1450,7 +1492,8 @@ abstract class _$$TypeOfDiaryModelImplCopyWith<$Res>
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "has_chosen_diet") bool hasChosenDiet,
|
||||
@JsonKey(name: "has_chosen_plan") bool hasChosenPlan});
|
||||
@JsonKey(name: "has_chosen_plan") bool hasChosenPlan,
|
||||
@JsonKey(name: "last_state") DiaryStateEnum diaryState});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1468,6 +1511,7 @@ class __$$TypeOfDiaryModelImplCopyWithImpl<$Res>
|
||||
$Res call({
|
||||
Object? hasChosenDiet = null,
|
||||
Object? hasChosenPlan = null,
|
||||
Object? diaryState = null,
|
||||
}) {
|
||||
return _then(_$TypeOfDiaryModelImpl(
|
||||
hasChosenDiet: null == hasChosenDiet
|
||||
@@ -1478,6 +1522,10 @@ class __$$TypeOfDiaryModelImplCopyWithImpl<$Res>
|
||||
? _value.hasChosenPlan
|
||||
: hasChosenPlan // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
diaryState: null == diaryState
|
||||
? _value.diaryState
|
||||
: diaryState // ignore: cast_nullable_to_non_nullable
|
||||
as DiaryStateEnum,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1487,7 +1535,8 @@ class __$$TypeOfDiaryModelImplCopyWithImpl<$Res>
|
||||
class _$TypeOfDiaryModelImpl implements _TypeOfDiaryModel {
|
||||
const _$TypeOfDiaryModelImpl(
|
||||
{@JsonKey(name: "has_chosen_diet") required this.hasChosenDiet,
|
||||
@JsonKey(name: "has_chosen_plan") required this.hasChosenPlan});
|
||||
@JsonKey(name: "has_chosen_plan") required this.hasChosenPlan,
|
||||
@JsonKey(name: "last_state") required this.diaryState});
|
||||
|
||||
factory _$TypeOfDiaryModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$TypeOfDiaryModelImplFromJson(json);
|
||||
@@ -1498,10 +1547,13 @@ class _$TypeOfDiaryModelImpl implements _TypeOfDiaryModel {
|
||||
@override
|
||||
@JsonKey(name: "has_chosen_plan")
|
||||
final bool hasChosenPlan;
|
||||
@override
|
||||
@JsonKey(name: "last_state")
|
||||
final DiaryStateEnum diaryState;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TypeOfDiaryModel(hasChosenDiet: $hasChosenDiet, hasChosenPlan: $hasChosenPlan)';
|
||||
return 'TypeOfDiaryModel(hasChosenDiet: $hasChosenDiet, hasChosenPlan: $hasChosenPlan, diaryState: $diaryState)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1512,12 +1564,15 @@ class _$TypeOfDiaryModelImpl implements _TypeOfDiaryModel {
|
||||
(identical(other.hasChosenDiet, hasChosenDiet) ||
|
||||
other.hasChosenDiet == hasChosenDiet) &&
|
||||
(identical(other.hasChosenPlan, hasChosenPlan) ||
|
||||
other.hasChosenPlan == hasChosenPlan));
|
||||
other.hasChosenPlan == hasChosenPlan) &&
|
||||
(identical(other.diaryState, diaryState) ||
|
||||
other.diaryState == diaryState));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, hasChosenDiet, hasChosenPlan);
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, hasChosenDiet, hasChosenPlan, diaryState);
|
||||
|
||||
/// Create a copy of TypeOfDiaryModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -1539,8 +1594,9 @@ class _$TypeOfDiaryModelImpl implements _TypeOfDiaryModel {
|
||||
abstract class _TypeOfDiaryModel implements TypeOfDiaryModel {
|
||||
const factory _TypeOfDiaryModel(
|
||||
{@JsonKey(name: "has_chosen_diet") required final bool hasChosenDiet,
|
||||
@JsonKey(name: "has_chosen_plan")
|
||||
required final bool hasChosenPlan}) = _$TypeOfDiaryModelImpl;
|
||||
@JsonKey(name: "has_chosen_plan") required final bool hasChosenPlan,
|
||||
@JsonKey(name: "last_state")
|
||||
required final DiaryStateEnum diaryState}) = _$TypeOfDiaryModelImpl;
|
||||
|
||||
factory _TypeOfDiaryModel.fromJson(Map<String, dynamic> json) =
|
||||
_$TypeOfDiaryModelImpl.fromJson;
|
||||
@@ -1551,6 +1607,9 @@ abstract class _TypeOfDiaryModel implements TypeOfDiaryModel {
|
||||
@override
|
||||
@JsonKey(name: "has_chosen_plan")
|
||||
bool get hasChosenPlan;
|
||||
@override
|
||||
@JsonKey(name: "last_state")
|
||||
DiaryStateEnum get diaryState;
|
||||
|
||||
/// Create a copy of TypeOfDiaryModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
@@ -31,6 +31,7 @@ _$DiaryDayModelImpl _$$DiaryDayModelImplFromJson(Map<String, dynamic> json) =>
|
||||
meals: (json['meals'] as List<dynamic>)
|
||||
.map((e) => MealModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
chosenPlanId: (json['chosen_plan_id'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DiaryDayModelImplToJson(_$DiaryDayModelImpl instance) =>
|
||||
@@ -43,6 +44,7 @@ Map<String, dynamic> _$$DiaryDayModelImplToJson(_$DiaryDayModelImpl instance) =>
|
||||
'comment': instance.comment,
|
||||
'state': instance.typeOfDiary,
|
||||
'meals': instance.meals,
|
||||
'chosen_plan_id': instance.chosenPlanId,
|
||||
};
|
||||
|
||||
_$MealModelImpl _$$MealModelImplFromJson(Map<String, dynamic> json) =>
|
||||
@@ -127,6 +129,7 @@ _$TypeOfDiaryModelImpl _$$TypeOfDiaryModelImplFromJson(
|
||||
_$TypeOfDiaryModelImpl(
|
||||
hasChosenDiet: json['has_chosen_diet'] as bool,
|
||||
hasChosenPlan: json['has_chosen_plan'] as bool,
|
||||
diaryState: $enumDecode(_$DiaryStateEnumEnumMap, json['last_state']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$TypeOfDiaryModelImplToJson(
|
||||
@@ -134,8 +137,20 @@ Map<String, dynamic> _$$TypeOfDiaryModelImplToJson(
|
||||
<String, dynamic>{
|
||||
'has_chosen_diet': instance.hasChosenDiet,
|
||||
'has_chosen_plan': instance.hasChosenPlan,
|
||||
'last_state': _$DiaryStateEnumEnumMap[instance.diaryState]!,
|
||||
};
|
||||
|
||||
const _$DiaryStateEnumEnumMap = {
|
||||
DiaryStateEnum.init: 'init',
|
||||
DiaryStateEnum.started: 'started',
|
||||
DiaryStateEnum.finished: 'finished',
|
||||
DiaryStateEnum.commented: 'commented',
|
||||
DiaryStateEnum.reviewedByUser: 'reviewed_by_user',
|
||||
DiaryStateEnum.lastDayStarted: 'last_day_started',
|
||||
DiaryStateEnum.lastDayFinished: 'last_day_finished',
|
||||
DiaryStateEnum.lastDayCommented: 'last_day_commented',
|
||||
};
|
||||
|
||||
_$ProductInMealImpl _$$ProductInMealImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ProductInMealImpl(
|
||||
productName: json['product_name'] as String,
|
||||
|
||||
Reference in New Issue
Block a user