forked from eatvio/eatvio_app
feat(feed): добавлен аватар автора, имя и время создания поста. добавлено количетсво лайков, комментариев и просмотров. при нажатии на комментарий, открываеться экран с постом
This commit is contained in:
@@ -38,13 +38,19 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(radius: 20),
|
||||
CircleAvatar(
|
||||
radius: 20,
|
||||
backgroundColor: Colors.black12,
|
||||
foregroundImage: NetworkImage(
|
||||
widget.feedBlogPostModel.author.authorProfileIcon,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Имя автора'),
|
||||
Text('Время поста'),
|
||||
Text(widget.feedBlogPostModel.author.authorName),
|
||||
Text(calculateDifference(widget.feedBlogPostModel.createdAt)),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -94,9 +100,16 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
_iconButton(Icons.favorite_border_rounded),
|
||||
_iconButton(Icons.favorite_border_rounded, widget.feedBlogPostModel.totalLikes.toString()),
|
||||
SizedBox(width: 8),
|
||||
_iconButton(Icons.mode_comment_outlined),
|
||||
_iconButton(
|
||||
Icons.mode_comment_outlined,
|
||||
widget.feedBlogPostModel.totalComments.toString(),
|
||||
() => GoRouter.of(context).pushNamed(
|
||||
'blogPostScreen',
|
||||
extra: widget.feedBlogPostModel,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
_iconButton(Icons.reply_rounded),
|
||||
Spacer(),
|
||||
@@ -107,7 +120,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
'0',
|
||||
widget.feedBlogPostModel.totalViews.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: appTheme.gray500,
|
||||
@@ -124,9 +137,9 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
_iconButton(IconData icon, [String? text]) {
|
||||
_iconButton(IconData icon, [String? text, Function()? onTap]) {
|
||||
return InkWell(
|
||||
onTap: () {},
|
||||
onTap: onTap ?? () {},
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: Ink(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
|
||||
|
||||
Reference in New Issue
Block a user