feat(plans): plan creating has been completed

This commit is contained in:
Username1548
2025-04-29 14:44:33 +07:00
parent c8b828bfe1
commit 0fcb2c1a0d
43 changed files with 1602 additions and 635 deletions

View File

@@ -1,3 +1,4 @@
import 'package:collection/collection.dart';
import 'package:eatvio_app/core/theme/custom_text_style.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/features/diary/presentation/bloc/diary_cubit.dart';
@@ -81,8 +82,10 @@ class _MealWidgetState extends State<MealWidget> {
BlocBuilder<DiaryCubit, DiaryState>(
builder: (context, state) {
if (state is DiaryStateLoaded) {
final mealsComments = state.consultantReview?.consultantComments.mealsComments;
if (mealsComments != null && (state.selectedMeal - 1 < mealsComments.length)) {
final consultantCommentOfMeal = state.consultantReview?.consultantComments.mealsComments.firstWhereOrNull(
(element) => element.typeNo == state.selectedMeal,
);
if (consultantCommentOfMeal != null) {
return Column(
children: [
Text(
@@ -90,7 +93,7 @@ class _MealWidgetState extends State<MealWidget> {
style: TextStyles.textLSemibold.copyWith(color: appTheme.black),
),
const SizedBox(height: 12),
CommentContainer(comment: mealsComments[state.selectedMeal - 1].comment),
CommentContainer(comment: consultantCommentOfMeal.comment),
],
);
}