updated designe of aboute diet page

This commit is contained in:
Username1548
2024-11-11 21:10:38 +07:00
parent a9b28c27b9
commit c5e1c5d9b8
46 changed files with 2164 additions and 1012 deletions

View File

@@ -1,6 +1,7 @@
import 'package:eatvio_app/core/utils/date_time_utils.dart';
import 'package:eatvio_app/features/feed/models/comment_model.dart';
import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart';
import 'package:eatvio_app/generated/l10n.dart';
import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -28,15 +29,16 @@ class CommentsWidget extends StatefulWidget {
class _CommentsWidgetState extends State<CommentsWidget> {
@override
Widget build(BuildContext context) {
final s = S.of(context);
return Column(
children: [
for (int i = 0; i < widget.comment.data.length; i++) ...[
_comment(widget.comment.data[i]),
_comment(s, widget.comment.data[i]),
if (widget.comment.data[i].childrenComments.isNotEmpty) SizedBox(height: 8),
for (int j = 0; j < widget.comment.data[i].childrenComments.length; j++)
Padding(
padding: EdgeInsets.only(left: 40),
child: _comment(widget.comment.data[i].childrenComments[j], 12, true),
child: _comment(s, widget.comment.data[i].childrenComments[j], 16, true),
),
SizedBox(height: 8),
],
@@ -44,7 +46,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
);
}
_comment(Comment comment, [double radius = 16, bool isChild = false]) {
_comment(S s, Comment comment, [double radius = 18, bool isChild = false]) {
return Container(
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
@@ -69,16 +71,19 @@ class _CommentsWidgetState extends State<CommentsWidget> {
comment.authorName,
style: TextStyle(
height: 1,
color: Colors.grey.shade600,
color: appTheme.grey,
fontSize: 12,
fontWeight: FontWeight.w500,
),
),
SizedBox(width: 4),
SizedBox(height: 4),
Text(
comment.body,
style: TextStyle(
height: 1,
color: Colors.black,
color: appTheme.blueGray800,
fontSize: 12,
fontWeight: FontWeight.w500,
),
),
SizedBox(height: 4),
@@ -87,10 +92,10 @@ class _CommentsWidgetState extends State<CommentsWidget> {
Text(
comment.createdAt.format('dd MMMM', 'ru'),
style: TextStyle(
color: Colors.grey.shade600,
fontSize: 12,
fontWeight: FontWeight.w400,
height: 1,
color: appTheme.grey,
fontSize: 12,
fontWeight: FontWeight.w500,
),
),
SizedBox(width: 16),
@@ -100,11 +105,11 @@ class _CommentsWidgetState extends State<CommentsWidget> {
context.read<CommentsCubit>().setReplyId(comment.id);
},
child: Text(
'Ответить',
s.answer,
style: TextStyle(
height: 1,
color: appTheme.grey,
fontSize: 12,
color: Colors.grey.shade800,
fontWeight: FontWeight.w500,
),
),