forked from eatvio/eatvio_app
feat(profile): add profile charts models, requests. Max length of description in posts, recipes, diets = 200
This commit is contained in:
@@ -19,13 +19,13 @@ class CommentsCubit extends Cubit<CommentsState> {
|
||||
try {
|
||||
switch (commentSourceType) {
|
||||
case CommentSourceType.blogPost:
|
||||
emit(CommentsState.loaded(comment: await feedRepository.getBlogPostComments(id)));
|
||||
emit(CommentsState.loaded(comment: await feedRepository.getBlogPostComments(id: id)));
|
||||
break;
|
||||
case CommentSourceType.diet:
|
||||
emit(CommentsState.loaded(comment: await feedRepository.getDietsComments(id)));
|
||||
emit(CommentsState.loaded(comment: await feedRepository.getDietsComments(id: id)));
|
||||
break;
|
||||
case CommentSourceType.recipe:
|
||||
emit(CommentsState.loaded(comment: await feedRepository.getRecipesComments(id)));
|
||||
emit(CommentsState.loaded(comment: await feedRepository.getRecipesComments(id: id)));
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -24,7 +24,6 @@ mixin _$CommentsState {
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
@@ -71,16 +70,18 @@ mixin _$CommentsState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CommentsStateCopyWith<$Res> {
|
||||
factory $CommentsStateCopyWith(CommentsState value, $Res Function(CommentsState) then) = _$CommentsStateCopyWithImpl<$Res, CommentsState>;
|
||||
factory $CommentsStateCopyWith(
|
||||
CommentsState value, $Res Function(CommentsState) then) =
|
||||
_$CommentsStateCopyWithImpl<$Res, CommentsState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> implements $CommentsStateCopyWith<$Res> {
|
||||
class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState>
|
||||
implements $CommentsStateCopyWith<$Res> {
|
||||
_$CommentsStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@@ -90,12 +91,18 @@ class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> implements $
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CommentsStateImplCopyWith<$Res> {
|
||||
factory _$$CommentsStateImplCopyWith(_$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) = __$$CommentsStateImplCopyWithImpl<$Res>;
|
||||
factory _$$CommentsStateImplCopyWith(
|
||||
_$CommentsStateImpl value, $Res Function(_$CommentsStateImpl) then) =
|
||||
__$$CommentsStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CommentsStateImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl> implements _$$CommentsStateImplCopyWith<$Res> {
|
||||
__$$CommentsStateImplCopyWithImpl(_$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) : super(_value, _then);
|
||||
class __$$CommentsStateImplCopyWithImpl<$Res>
|
||||
extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateImpl>
|
||||
implements _$$CommentsStateImplCopyWith<$Res> {
|
||||
__$$CommentsStateImplCopyWithImpl(
|
||||
_$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CommentsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -113,7 +120,8 @@ class _$CommentsStateImpl implements _CommentsState {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateImpl);
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$CommentsStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -200,14 +208,18 @@ abstract class _CommentsState implements CommentsState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CommentsStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value, $Res Function(_$CommentsStateLoadingImpl) then) =
|
||||
factory _$$CommentsStateLoadingImplCopyWith(_$CommentsStateLoadingImpl value,
|
||||
$Res Function(_$CommentsStateLoadingImpl) then) =
|
||||
__$$CommentsStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CommentsStateLoadingImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl>
|
||||
class __$$CommentsStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadingImpl>
|
||||
implements _$$CommentsStateLoadingImplCopyWith<$Res> {
|
||||
__$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, $Res Function(_$CommentsStateLoadingImpl) _then) : super(_value, _then);
|
||||
__$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value,
|
||||
$Res Function(_$CommentsStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CommentsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -225,7 +237,9 @@ class _$CommentsStateLoadingImpl implements CommentsStateLoading {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType && other is _$CommentsStateLoadingImpl);
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CommentsStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -312,9 +326,9 @@ abstract class CommentsStateLoading implements CommentsState {
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CommentsStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value, $Res Function(_$CommentsStateLoadedImpl) then) =
|
||||
factory _$$CommentsStateLoadedImplCopyWith(_$CommentsStateLoadedImpl value,
|
||||
$Res Function(_$CommentsStateLoadedImpl) then) =
|
||||
__$$CommentsStateLoadedImplCopyWithImpl<$Res>;
|
||||
|
||||
@useResult
|
||||
$Res call({CommentModel comment, int? replyId});
|
||||
|
||||
@@ -322,9 +336,12 @@ abstract class _$$CommentsStateLoadedImplCopyWith<$Res> {
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CommentsStateLoadedImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl>
|
||||
class __$$CommentsStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateLoadedImpl>
|
||||
implements _$$CommentsStateLoadedImplCopyWith<$Res> {
|
||||
__$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value, $Res Function(_$CommentsStateLoadedImpl) _then) : super(_value, _then);
|
||||
__$$CommentsStateLoadedImplCopyWithImpl(_$CommentsStateLoadedImpl _value,
|
||||
$Res Function(_$CommentsStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CommentsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -390,7 +407,8 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded {
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith =>
|
||||
__$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>(this, _$identity);
|
||||
__$$CommentsStateLoadedImplCopyWithImpl<_$CommentsStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
@@ -468,31 +486,36 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded {
|
||||
}
|
||||
|
||||
abstract class CommentsStateLoaded implements CommentsState {
|
||||
const factory CommentsStateLoaded({required final CommentModel comment, final int? replyId}) = _$CommentsStateLoadedImpl;
|
||||
const factory CommentsStateLoaded(
|
||||
{required final CommentModel comment,
|
||||
final int? replyId}) = _$CommentsStateLoadedImpl;
|
||||
|
||||
CommentModel get comment;
|
||||
|
||||
int? get replyId;
|
||||
|
||||
/// Create a copy of CommentsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
_$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CommentsStateErrorImplCopyWith<$Res> {
|
||||
factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value, $Res Function(_$CommentsStateErrorImpl) then) =
|
||||
factory _$$CommentsStateErrorImplCopyWith(_$CommentsStateErrorImpl value,
|
||||
$Res Function(_$CommentsStateErrorImpl) then) =
|
||||
__$$CommentsStateErrorImplCopyWithImpl<$Res>;
|
||||
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CommentsStateErrorImplCopyWithImpl<$Res> extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl>
|
||||
class __$$CommentsStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$CommentsStateCopyWithImpl<$Res, _$CommentsStateErrorImpl>
|
||||
implements _$$CommentsStateErrorImplCopyWith<$Res> {
|
||||
__$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value, $Res Function(_$CommentsStateErrorImpl) _then) : super(_value, _then);
|
||||
__$$CommentsStateErrorImplCopyWithImpl(_$CommentsStateErrorImpl _value,
|
||||
$Res Function(_$CommentsStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CommentsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -528,7 +551,8 @@ class _$CommentsStateErrorImpl implements CommentsStateError {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CommentsStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -540,7 +564,8 @@ class _$CommentsStateErrorImpl implements CommentsStateError {
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith =>
|
||||
__$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>(this, _$identity);
|
||||
__$$CommentsStateErrorImplCopyWithImpl<_$CommentsStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
@@ -618,12 +643,14 @@ class _$CommentsStateErrorImpl implements CommentsStateError {
|
||||
}
|
||||
|
||||
abstract class CommentsStateError implements CommentsState {
|
||||
const factory CommentsStateError({required final String errorMessage}) = _$CommentsStateErrorImpl;
|
||||
const factory CommentsStateError({required final String errorMessage}) =
|
||||
_$CommentsStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of CommentsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => throw _privateConstructorUsedError;
|
||||
_$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user