feat(app): Feed, recipe, blog posts, diet and plan show and index pages, state management, API implementation and layouts

This commit is contained in:
2024-05-08 14:11:18 +03:00
parent 404b22e78a
commit 76a29ebf67
45 changed files with 2759 additions and 21 deletions

View File

@@ -0,0 +1,49 @@
// ignore_for_file: must_be_immutable
part of 'feed_bloc.dart';
class FeedState extends Equatable {
const FeedState({this.myProfileModelObj});
final FeedModel? myProfileModelObj;
@override
List<Object?> get props => [myProfileModelObj];
}
class FeedInitialState extends FeedState {
FeedInitialState({required FeedModel myProfileModelObj})
: super(myProfileModelObj: myProfileModelObj);
}
/// Represents the state of Feed in the application.
class FeedLoadedState extends FeedState {
FeedLoadedState({this.myProfileModelObj, this.posts})
: super(myProfileModelObj: null);
FeedModel? myProfileModelObj;
List<dynamic>? posts;
@override
List<Object?> get props => [
myProfileModelObj,
posts,
];
FeedLoadedState copyWith({
FeedModel? myProfileModelObj,
List<dynamic>? posts,
}) {
return FeedLoadedState(
myProfileModelObj: myProfileModelObj ?? this.myProfileModelObj,
posts: posts ?? this.posts,
);
}
}
class FeedErrorState extends FeedState {
final String errorMessage;
const FeedErrorState(this.errorMessage);
@override
List<Object> get props => [errorMessage];
}