diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c72f1ce3..afaf999f 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -386,8 +386,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 53; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; @@ -409,7 +409,7 @@ MARKETING_VERSION = 1.2.3; PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.eatvioapp.app 1747050044"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -536,8 +536,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 53; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; @@ -559,7 +559,7 @@ MARKETING_VERSION = 1.2.3; PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.eatvioapp.app 1747050044"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -574,8 +574,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 53; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; @@ -597,7 +597,7 @@ MARKETING_VERSION = 1.2.3; PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.eatvioapp.app 1747050044"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/lib/core/comments/presentation/comments_actions_bottom_sheet.dart b/lib/core/comments/presentation/comments_actions_bottom_sheet.dart index deeea5ff..5506215d 100644 --- a/lib/core/comments/presentation/comments_actions_bottom_sheet.dart +++ b/lib/core/comments/presentation/comments_actions_bottom_sheet.dart @@ -23,7 +23,7 @@ void showCommentsActionsBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, builder: (context) => Container( - margin: EdgeInsets.only(left: 8, right: 8, bottom: MediaQuery.of(context).padding.bottom), + margin: EdgeInsets.only(left: 8, right: 8, bottom: MediaQuery.of(context).padding.bottom + 20), decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), color: appTheme.whiteA700, @@ -189,11 +189,12 @@ class _ActionWidget extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 12), child: Row( children: [ - Text( - text, - style: TextStyles.textLMedium.copyWith(color: appTheme.black), + Expanded( + child: Text( + text, + style: TextStyles.textLMedium.copyWith(color: appTheme.black), + ), ), - const Spacer(), SvgPicture.asset(iconPath) ], ), diff --git a/lib/core/const.dart b/lib/core/const.dart index 618a9866..31c47e9c 100644 --- a/lib/core/const.dart +++ b/lib/core/const.dart @@ -1,4 +1,5 @@ String baseUrl = 'https://eatvio.ru'; +// String baseUrl = 'https://dev2.eatvio.com'; const List durationValues = [7, 14, 21]; diff --git a/lib/features/complaining/presentation/complaining_bottom_sheet.dart b/lib/features/complaining/presentation/complaining_bottom_sheet.dart index e3f42616..aa5e1b90 100644 --- a/lib/features/complaining/presentation/complaining_bottom_sheet.dart +++ b/lib/features/complaining/presentation/complaining_bottom_sheet.dart @@ -9,6 +9,7 @@ import 'package:eatvio_app/core/widgets/custom_text_form_field.dart'; import 'package:eatvio_app/core/widgets/loader.dart'; import 'package:eatvio_app/features/complaining/presentation/cubit/complaining_cubit.dart'; import 'package:eatvio_app/features/complaining/presentation/cubit/complaining_state.dart'; +import 'package:eatvio_app/features/create_diet/presentation/widgets/error_widget.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -194,63 +195,74 @@ class _LawViolationWidgetState extends State<_LawViolationWidget> { @override Widget build(BuildContext context) { final s = S.of(context); - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - const BottomSheetHandlerBar(), - const SizedBox(height: 20), - Text( - s.lawViolation, - style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black), - ), - const SizedBox(height: 8), - SizedBox( - width: MediaQuery.sizeOf(context).width * 0.7, - child: Text( - s.what_do_you_want_to_complaint_about, - textAlign: TextAlign.center, - style: TextStyles.textMMedium.copyWith(color: appTheme.black), - ), - ), - const SizedBox(height: 24), - ...tags.mapIndexed((index, element) { - return Row( - children: [ - Checkbox( - activeColor: appTheme.blueA400, - side: BorderSide(width: 2, color: tags[index].$1 ? appTheme.blueA400 : appTheme.blueGray), - value: element.$1, - onChanged: (isChecked) { - setState(() { - if (isChecked == null) return; - if (index == tags.length - 1 && !isChecked) { - context.read().toggleDescription(); - } - tags[index] = (isChecked, element.$2); - final activeTags = tags.where((elem) => elem.$1).map((e) => e.$2).toList(); - context.read().setTags(activeTags); - }); + return BlocBuilder( + builder: (context, state) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + const BottomSheetHandlerBar(), + const SizedBox(height: 20), + Text( + s.lawViolation, + style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black), + ), + const SizedBox(height: 8), + SizedBox( + width: MediaQuery.sizeOf(context).width * 0.7, + child: Text( + s.what_do_you_want_to_complaint_about, + textAlign: TextAlign.center, + style: TextStyles.textMMedium.copyWith(color: appTheme.black), + ), + ), + const SizedBox(height: 24), + ...tags.mapIndexed((index, element) { + return Row( + children: [ + Checkbox( + activeColor: appTheme.blueA400, + side: BorderSide(width: 2, color: tags[index].$1 ? appTheme.blueA400 : appTheme.blueGray), + value: element.$1, + onChanged: (isChecked) { + setState(() { + if (isChecked == null) return; + if (index == tags.length - 1 && !isChecked) { + context.read().toggleDescription(); + } + tags[index] = (isChecked, element.$2); + final activeTags = tags.where((elem) => elem.$1).map((e) => e.$2).toList(); + context.read().setTags(activeTags); + }); + }, + ), + Text( + element.$2, + style: TextStyles.textLSemibold.copyWith(color: appTheme.black), + ), + ], + ); + }), + if (tags.last.$1) ...[ + const SizedBox(height: 12), + CustomTextFormField( + hintText: s.type_here_your_complaint, + hasError: (state.complainInfo.description?.length ?? 10) < 10, + onChanged: (value) { + context.read().setDescription(value); }, ), - Text( - element.$2, - style: TextStyles.textLSemibold.copyWith(color: appTheme.black), - ), + if ((state.complainInfo.description?.length ?? 10) < 10) ...[ + const SizedBox(height: 4), + const ValidationErrorWidget(error: 'Минимум 10 символов'), + ] ], - ); - }), - if (tags.last.$1) ...[ - const SizedBox(height: 12), - CustomTextFormField( - hintText: s.type_here_your_complaint, - onChanged: (value) { - context.read().setDescription(value); - }, - ), - ], - const SizedBox(height: 20), - const _ComplainButton(), - ], + const SizedBox(height: 20), + _ComplainButton( + isDisabled: (state.complainInfo.description?.length ?? 0) < 10, + ), + ], + ); + }, ); } } @@ -515,8 +527,8 @@ class _ComplaintFailedWidget extends StatelessWidget { } class _ComplainButton extends StatelessWidget { - const _ComplainButton(); - + const _ComplainButton({this.isDisabled = false}); + final bool isDisabled; @override Widget build(BuildContext context) { final s = S.of(context); @@ -534,6 +546,10 @@ class _ComplainButton extends StatelessWidget { backgroundColor: WidgetStatePropertyAll(appTheme.blueA400), ), onPressed: () async { + if (isDisabled) { + context.read().setDescription(''); + return; + } await context.read().complain(); }, ); diff --git a/lib/features/consultations/presentation/widgets/consultation_card_widget.dart b/lib/features/consultations/presentation/widgets/consultation_card_widget.dart index 5173ab2d..04a0b7fb 100644 --- a/lib/features/consultations/presentation/widgets/consultation_card_widget.dart +++ b/lib/features/consultations/presentation/widgets/consultation_card_widget.dart @@ -302,7 +302,6 @@ class _ConsultationCardWidgetState extends State { 'diaryId': lastActiveDay.$2.id, 'currentDiaryDay': lastActiveDay.$1, }); - GoRouter.of(context).push(UserDiaryScreen.path, extra: lastActiveDay.$2.id); return; } showErrorDialog(context, diff --git a/lib/features/diary/presentation/bloc/diary_cubit.dart b/lib/features/diary/presentation/bloc/diary_cubit.dart index 45394cbe..9fd27c39 100644 --- a/lib/features/diary/presentation/bloc/diary_cubit.dart +++ b/lib/features/diary/presentation/bloc/diary_cubit.dart @@ -179,8 +179,11 @@ class DiaryCubit extends Cubit { int? currentPlanDay; String? planName; if (diaryDay.chosenPlanId != null) { - consultantReview = await diaryRepository.getDiaryComments(planId: diaryDay.chosenPlanId!, diaryId: diaryDay.id); final chosenPlanModel = await chatRepository.getChosenPlan(id: diaryDay.chosenPlanId!); + if (diaryDay.typeOfDiary.diaryState == DiaryStateEnum.lastDayCommented || diaryDay.typeOfDiary.diaryState == DiaryStateEnum.commented) { + await diaryRepository.viewCommentOfDiaryDayByConsultant(diaryId: diaryDay.id); + } + consultantReview = await diaryRepository.getDiaryComments(planId: diaryDay.chosenPlanId!, diaryId: diaryDay.id); planDuration = chosenPlanModel.plan.duration; planName = chosenPlanModel.plan.name; currentPlanDay = consultantReview.currentPlanDay; diff --git a/lib/features/diary/repositories/diary_repository.dart b/lib/features/diary/repositories/diary_repository.dart index 14a9576b..2ac30803 100644 --- a/lib/features/diary/repositories/diary_repository.dart +++ b/lib/features/diary/repositories/diary_repository.dart @@ -292,10 +292,17 @@ class DiaryRepository { required int diaryId, }) async { try { - await diaryService.viewCommentOfDiaryDayByConsultant(diaryId: diaryId); return await diaryService.getDiaryComments(planId: planId, diaryId: diaryId); } catch (e) { rethrow; } } + + Future viewCommentOfDiaryDayByConsultant({required int diaryId}) async { + try { + await diaryService.viewCommentOfDiaryDayByConsultant(diaryId: diaryId); + } catch (e) { + rethrow; + } + } }