forked from eatvio/eatvio_app
feat(feed): Comment and author info display
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [blog_post_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
import 'package:eatvio_app/presentation/feed/blog_post_screen/models/comment_model.dart';
|
||||
|
||||
class BlogPostModel extends Equatable {
|
||||
final String blog_postID;
|
||||
BlogPostModel({required this.blog_postID, this.comments = const []});
|
||||
List<CommentModel> comments;
|
||||
|
||||
BlogPostModel({required String blog_postID}) : blog_postID = blog_postID;
|
||||
|
||||
BlogPostModel copyWith(String blog_postID) {
|
||||
return BlogPostModel(blog_postID: blog_postID);
|
||||
BlogPostModel copyWith({String? blog_postID, List<CommentModel>? comments}) {
|
||||
return BlogPostModel(
|
||||
blog_postID: blog_postID ?? this.blog_postID,
|
||||
comments: comments ?? this.comments,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [blog_postID];
|
||||
List<Object?> get props => [blog_postID, comments];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
|
||||
/// This class is used in the [userprofile_item_widget] screen.
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
class CommentModel {
|
||||
CommentModel(
|
||||
{this.userImage,
|
||||
this.username,
|
||||
this.dateText,
|
||||
this.greetingText,
|
||||
required this.id}) {
|
||||
userImage = userImage ?? ImageConstant.imageNotFound;
|
||||
username = username;
|
||||
dateText = dateText;
|
||||
greetingText = greetingText;
|
||||
id = id;
|
||||
}
|
||||
|
||||
String? userImage;
|
||||
|
||||
String? username;
|
||||
|
||||
String? dateText;
|
||||
|
||||
String? greetingText;
|
||||
|
||||
String id;
|
||||
}
|
||||
Reference in New Issue
Block a user