fixed layout of diets feed and added text styles

This commit is contained in:
Username1548
2024-11-14 17:29:19 +07:00
parent cfffc1bfe3
commit 937d7cded5
37 changed files with 1451 additions and 982 deletions

View File

@@ -2,6 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:dismissible_page/dismissible_page.dart';
import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/utils/date_time_utils.dart';
import 'package:eatvio_app/core/widgets/feed_icon_button.dart';
import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart';
import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart';
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart';
@@ -153,7 +154,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
children: [
_iconButton(
FeedIconButton(
icon: isLiked ? Icons.favorite_rounded : Icons.favorite_border_rounded,
text: totalLikes.toString(),
iconColor: isLiked ? Colors.red.withOpacity(0.8) : null,
@@ -171,7 +172,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
},
),
SizedBox(width: 8),
_iconButton(
FeedIconButton(
svgIcon: SvgPicture.asset(
'assets/icons/comment.svg',
height: 20,
@@ -188,7 +189,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
),
),
SizedBox(width: 8),
_iconButton(
FeedIconButton(
svgIcon: SvgPicture.asset(
height: 20,
width: 20,
@@ -225,40 +226,4 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
),
);
}
_iconButton({IconData? icon, SvgPicture? svgIcon, String? text, Function()? onTap, Color? iconColor, Color? backgroundColor, Color? textColor}) {
return InkWell(
onTap: onTap ?? () {},
borderRadius: BorderRadius.circular(16),
child: Ink(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(
color: backgroundColor ?? appTheme.gray100,
borderRadius: BorderRadius.circular(16),
),
height: 32,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (svgIcon != null) svgIcon,
if (icon != null)
Icon(
icon,
size: 20,
color: iconColor ?? appTheme.gray600,
),
if (text != null) SizedBox(width: 8),
if (text != null)
Text(
text,
style: TextStyle(
color: textColor ?? appTheme.gray600,
fontWeight: FontWeight.w500,
),
),
],
),
),
);
}
}