forked from eatvio/eatvio_app
feat(diary): wakeup, retire, mood, comment
This commit is contained in:
@@ -4,12 +4,9 @@ part 'finish_diary_day_model.freezed.dart';
|
||||
|
||||
part 'finish_diary_day_model.g.dart';
|
||||
|
||||
@freezed
|
||||
@Freezed()
|
||||
class FinishDiaryDayModel with _$FinishDiaryDayModel {
|
||||
const factory FinishDiaryDayModel({
|
||||
required String wakeUp,
|
||||
required String retire,
|
||||
}) = _FinishDiaryDayModel;
|
||||
const factory FinishDiaryDayModel({required String wakeUp, required String retire, @JsonKey(includeIfNull: false) String? comment}) = _FinishDiaryDayModel;
|
||||
|
||||
factory FinishDiaryDayModel.fromJson(Map<String, Object?> json) => _$FinishDiaryDayModelFromJson(json);
|
||||
factory FinishDiaryDayModel.fromJson(Map<String, dynamic> json) => _$FinishDiaryDayModelFromJson(json);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ FinishDiaryDayModel _$FinishDiaryDayModelFromJson(Map<String, dynamic> json) {
|
||||
mixin _$FinishDiaryDayModel {
|
||||
String get wakeUp => throw _privateConstructorUsedError;
|
||||
String get retire => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get comment => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this FinishDiaryDayModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -41,7 +43,11 @@ abstract class $FinishDiaryDayModelCopyWith<$Res> {
|
||||
$Res Function(FinishDiaryDayModel) then,
|
||||
) = _$FinishDiaryDayModelCopyWithImpl<$Res, FinishDiaryDayModel>;
|
||||
@useResult
|
||||
$Res call({String wakeUp, String retire});
|
||||
$Res call({
|
||||
String wakeUp,
|
||||
String retire,
|
||||
@JsonKey(includeIfNull: false) String? comment,
|
||||
});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -58,7 +64,11 @@ class _$FinishDiaryDayModelCopyWithImpl<$Res, $Val extends FinishDiaryDayModel>
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({Object? wakeUp = null, Object? retire = null}) {
|
||||
$Res call({
|
||||
Object? wakeUp = null,
|
||||
Object? retire = null,
|
||||
Object? comment = freezed,
|
||||
}) {
|
||||
return _then(
|
||||
_value.copyWith(
|
||||
wakeUp:
|
||||
@@ -71,6 +81,11 @@ class _$FinishDiaryDayModelCopyWithImpl<$Res, $Val extends FinishDiaryDayModel>
|
||||
? _value.retire
|
||||
: retire // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
comment:
|
||||
freezed == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
)
|
||||
as $Val,
|
||||
);
|
||||
@@ -86,7 +101,11 @@ abstract class _$$FinishDiaryDayModelImplCopyWith<$Res>
|
||||
) = __$$FinishDiaryDayModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String wakeUp, String retire});
|
||||
$Res call({
|
||||
String wakeUp,
|
||||
String retire,
|
||||
@JsonKey(includeIfNull: false) String? comment,
|
||||
});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -102,7 +121,11 @@ class __$$FinishDiaryDayModelImplCopyWithImpl<$Res>
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({Object? wakeUp = null, Object? retire = null}) {
|
||||
$Res call({
|
||||
Object? wakeUp = null,
|
||||
Object? retire = null,
|
||||
Object? comment = freezed,
|
||||
}) {
|
||||
return _then(
|
||||
_$FinishDiaryDayModelImpl(
|
||||
wakeUp:
|
||||
@@ -115,6 +138,11 @@ class __$$FinishDiaryDayModelImplCopyWithImpl<$Res>
|
||||
? _value.retire
|
||||
: retire // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
comment:
|
||||
freezed == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -123,7 +151,11 @@ class __$$FinishDiaryDayModelImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$FinishDiaryDayModelImpl implements _FinishDiaryDayModel {
|
||||
const _$FinishDiaryDayModelImpl({required this.wakeUp, required this.retire});
|
||||
const _$FinishDiaryDayModelImpl({
|
||||
required this.wakeUp,
|
||||
required this.retire,
|
||||
@JsonKey(includeIfNull: false) this.comment,
|
||||
});
|
||||
|
||||
factory _$FinishDiaryDayModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$FinishDiaryDayModelImplFromJson(json);
|
||||
@@ -132,10 +164,13 @@ class _$FinishDiaryDayModelImpl implements _FinishDiaryDayModel {
|
||||
final String wakeUp;
|
||||
@override
|
||||
final String retire;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? comment;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FinishDiaryDayModel(wakeUp: $wakeUp, retire: $retire)';
|
||||
return 'FinishDiaryDayModel(wakeUp: $wakeUp, retire: $retire, comment: $comment)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -144,12 +179,13 @@ class _$FinishDiaryDayModelImpl implements _FinishDiaryDayModel {
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FinishDiaryDayModelImpl &&
|
||||
(identical(other.wakeUp, wakeUp) || other.wakeUp == wakeUp) &&
|
||||
(identical(other.retire, retire) || other.retire == retire));
|
||||
(identical(other.retire, retire) || other.retire == retire) &&
|
||||
(identical(other.comment, comment) || other.comment == comment));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, wakeUp, retire);
|
||||
int get hashCode => Object.hash(runtimeType, wakeUp, retire, comment);
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -172,6 +208,7 @@ abstract class _FinishDiaryDayModel implements FinishDiaryDayModel {
|
||||
const factory _FinishDiaryDayModel({
|
||||
required final String wakeUp,
|
||||
required final String retire,
|
||||
@JsonKey(includeIfNull: false) final String? comment,
|
||||
}) = _$FinishDiaryDayModelImpl;
|
||||
|
||||
factory _FinishDiaryDayModel.fromJson(Map<String, dynamic> json) =
|
||||
@@ -181,6 +218,9 @@ abstract class _FinishDiaryDayModel implements FinishDiaryDayModel {
|
||||
String get wakeUp;
|
||||
@override
|
||||
String get retire;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get comment;
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
@@ -11,8 +11,13 @@ _$FinishDiaryDayModelImpl _$$FinishDiaryDayModelImplFromJson(
|
||||
) => _$FinishDiaryDayModelImpl(
|
||||
wakeUp: json['wakeUp'] as String,
|
||||
retire: json['retire'] as String,
|
||||
comment: json['comment'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$FinishDiaryDayModelImplToJson(
|
||||
_$FinishDiaryDayModelImpl instance,
|
||||
) => <String, dynamic>{'wakeUp': instance.wakeUp, 'retire': instance.retire};
|
||||
) => <String, dynamic>{
|
||||
'wakeUp': instance.wakeUp,
|
||||
'retire': instance.retire,
|
||||
if (instance.comment case final value?) 'comment': value,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user