From 2adedf16aed9f2d925c8e268191568fd40cf0705 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 12 May 2025 15:50:42 +0300 Subject: [PATCH 1/9] feat(comments): onTap to profile --- lib/features/feed/models/comment_model.dart | 1 + .../presentation/widgets/comments_widget.dart | 26 ++++++++++++++++--- .../widgets/consultant_widget.dart | 5 +++- .../presentation/pages/profile_screen.dart | 14 +++++----- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/lib/features/feed/models/comment_model.dart b/lib/features/feed/models/comment_model.dart index 1fbcb145..258bbd17 100644 --- a/lib/features/feed/models/comment_model.dart +++ b/lib/features/feed/models/comment_model.dart @@ -20,6 +20,7 @@ class Comment with _$Comment { const factory Comment({ @JsonKey(name: "id") required int id, @JsonKey(name: "author_name") required String authorName, + @JsonKey(name: "author_slug") required String authorSlug, @JsonKey(name: "author_profile_icon") required String authorProfileIcon, @JsonKey(name: "body") required String body, @JsonKey(name: "children_comments") required List childrenComments, diff --git a/lib/features/feed/presentation/widgets/comments_widget.dart b/lib/features/feed/presentation/widgets/comments_widget.dart index 338e4f5a..b12b691e 100644 --- a/lib/features/feed/presentation/widgets/comments_widget.dart +++ b/lib/features/feed/presentation/widgets/comments_widget.dart @@ -1,10 +1,15 @@ +import 'package:eatvio_app/core/locator_service.dart'; import 'package:eatvio_app/core/utils/date_time_utils.dart'; +import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; +import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart'; import 'package:eatvio_app/features/feed/models/comment_model.dart'; +import 'package:eatvio_app/features/feed/models/diets_pagination_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/core/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:go_router/go_router.dart'; enum CommentSourceType { blogPost, recipe, diet, plan } @@ -59,10 +64,23 @@ class _CommentsWidgetState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - CircleAvatar( - foregroundImage: NetworkImage(comment.authorProfileIcon), - backgroundImage: const AssetImage('assets/images/no_avatar.png'), - radius: radius, + GestureDetector( + onTap: () { + GoRouter.of(context).pushNamed( + 'profileScreen', + extra: Author( + authorSlug: comment.authorSlug, + authorName: comment.authorName, + authorProfileIcon: comment.authorProfileIcon, + authorIsMe: (sl().state as ProfileAvatarStateLoaded).profile.slug == comment.authorSlug ? true : false, + ), + ); + }, + child: CircleAvatar( + foregroundImage: NetworkImage(comment.authorProfileIcon), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), + radius: radius, + ), ), const SizedBox(width: 8), Column( diff --git a/lib/features/feed/presentation/widgets/consultant_widget.dart b/lib/features/feed/presentation/widgets/consultant_widget.dart index 061bc0db..5246d348 100644 --- a/lib/features/feed/presentation/widgets/consultant_widget.dart +++ b/lib/features/feed/presentation/widgets/consultant_widget.dart @@ -1,6 +1,9 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/locator_service.dart'; import 'package:eatvio_app/core/theme/theme_helper.dart'; +import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; +import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/models/feed_consultant_model.dart'; import 'package:eatvio_app/features/profile/models/badge_model.dart'; @@ -26,7 +29,7 @@ class ConsultantWidget extends StatelessWidget { authorSlug: consultant.slug, authorName: consultant.name, authorProfileIcon: consultant.photo, - authorIsMe: false, + authorIsMe: (sl().state as ProfileAvatarStateLoaded).profile.slug == consultant.slug ? true : false, ), ); }, diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index e127d68c..df96f608 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -66,7 +66,7 @@ class _ProfileScreenState extends State { @override void initState() { super.initState(); - widget.author == null ? profileCubit.getMyProfile() : profileCubit.getProfileBySlug(widget.author!.authorSlug); + widget.author == null || widget.author!.authorIsMe ? profileCubit.getMyProfile() : profileCubit.getProfileBySlug(widget.author!.authorSlug); } @override @@ -89,11 +89,11 @@ class _ProfileScreenState extends State { } isFirstFetch = false; } - return widget.author == null ? _myProfileScreen(state) : _profileScreen(state); + return widget.author == null || widget.author!.authorIsMe ? _myProfileScreen(state) : _profileScreen(state); } else if (state is ProfileStateError) { return DataErrorWidget( onReload: () async { - widget.author == null ? await profileCubit.getMyProfile() : await profileCubit.getProfileBySlug(widget.author!.authorSlug); + widget.author == null || widget.author!.authorIsMe ? await profileCubit.getMyProfile() : await profileCubit.getProfileBySlug(widget.author!.authorSlug); }, ); } else { @@ -393,7 +393,7 @@ class _ProfileScreenState extends State { ), ), Text( - widget.author == null ? 'Редактировать' : '', + widget.author == null || widget.author!.authorIsMe ? 'Редактировать' : '', style: const TextStyle( color: Color(0xFF2F80ED), fontSize: 16, @@ -478,7 +478,7 @@ class _ProfileScreenState extends State { ), ), Text( - widget.author == null ? 'Редактировать' : '', + widget.author == null || widget.author!.authorIsMe ? 'Редактировать' : '', style: const TextStyle( color: Color(0xFF2F80ED), fontSize: 16, @@ -955,12 +955,12 @@ class _ProfileScreenState extends State { value: 'view', child: Text('Посмотреть'), ), - if (widget.author == null) + if (widget.author == null || widget.author!.authorIsMe) const PopupMenuItem( value: 'replace', child: Text('Заменить'), ), - if (widget.author == null) + if (widget.author == null || widget.author!.authorIsMe) const PopupMenuItem( value: 'delete', child: Text('Удалить'), From 82fffec5f5fb1eb938c3a007d1a7200fc710477d Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 12 May 2025 13:31:40 +0000 Subject: [PATCH 2/9] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20.gitea/workflows/test.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 8c247e87..20ee9c53 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -104,14 +104,27 @@ jobs: - name: Test run: flutter test + - name: Create key.properties file + run: | + cat > android/key.properties < android/app/my-release-key.jks + - name: Build apk - run: flutter build apk --profile + run: flutter build apk --release - name: Rename and move apk run: | TIMESTAMP=$(TZ=Europe/Moscow date +'%Y-%m-%d-%H-%M') APK_NAME="eatvio_app_${TIMESTAMP}.apk" - mv build/app/outputs/flutter-apk/app-profile.apk $APK_NAME + mv build/app/outputs/flutter-apk/app-release.apk $APK_NAME echo "APK build finished $APK_NAME" echo "APK_NAME=$APK_NAME" >> $GITHUB_ENV From 8cd99721127be589dbc63f68993f2baecfc874b7 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 12 May 2025 17:14:36 +0300 Subject: [PATCH 3/9] feat(testflight): change to distribution --- .DS_Store | Bin 10244 -> 10244 bytes ios/Runner.xcodeproj/project.pbxproj | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.DS_Store b/.DS_Store index 097b747a3befbb4b0b1709860d28a9e8dc21a8f5..31ef8af3860347abc958d07f17c7576a3f66fe81 100644 GIT binary patch delta 37 tcmZn(XbG6$&uFUkbiOnhkTRAr8OU+>2*f5Q8GrPiHb^!L_4Fv!I delta 234 zcmZn(XbG6$&*-o*U^hRb!{h`3iOnhkTRDtb8Il-E88R7i7*afQ@{^Nt@{<@C7z7v? zn9>;-82SE#0Z@d20j_fL6`_{NOQc-u;UWwvIq8PM$@#ejAcfhN54=TI&ybRv@8SYA sndAHQH&<88JLZV4B87m8f((QWx%)x(@F1MTkh1xd#B$cn> Date: Mon, 12 May 2025 17:17:30 +0300 Subject: [PATCH 4/9] feat(testflight): ci/cd --- ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 4ae30ed9..2ebee285 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -387,7 +387,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; @@ -409,7 +409,7 @@ MARKETING_VERSION = 1.0.50; PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.eatvioapp.app 1747050044"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -537,7 +537,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; @@ -559,7 +559,7 @@ MARKETING_VERSION = 1.0.50; PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.eatvioapp.app 1747050044"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -575,7 +575,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; @@ -597,7 +597,7 @@ MARKETING_VERSION = 1.0.50; PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.eatvioapp.app 1747050044"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; From dca32573867240e8c945c717c171d7b50351bd1f Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 12 May 2025 14:36:41 +0000 Subject: [PATCH 5/9] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20.gitea/workflows/test-flight-cd.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test-flight-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test-flight-cd.yaml b/.gitea/workflows/test-flight-cd.yaml index 5d7e74ae..871df3f0 100644 --- a/.gitea/workflows/test-flight-cd.yaml +++ b/.gitea/workflows/test-flight-cd.yaml @@ -19,7 +19,7 @@ jobs: flutter pub run build_runner build --delete-conflicting-outputs cd ios pod update - fastlane beta + sudo fastlane beta env: LANG: en_US.UTF-8 LC_ALL: en_US.UTF-8 From 21e8a7cedfbaf66849074c9404411cdb8d2368a0 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 12 May 2025 14:37:57 +0000 Subject: [PATCH 6/9] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20.gitea/workflows/test-flight-cd.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test-flight-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test-flight-cd.yaml b/.gitea/workflows/test-flight-cd.yaml index 871df3f0..5d7e74ae 100644 --- a/.gitea/workflows/test-flight-cd.yaml +++ b/.gitea/workflows/test-flight-cd.yaml @@ -19,7 +19,7 @@ jobs: flutter pub run build_runner build --delete-conflicting-outputs cd ios pod update - sudo fastlane beta + fastlane beta env: LANG: en_US.UTF-8 LC_ALL: en_US.UTF-8 From cdfd2769f03d929e30103191dcd92da09db2badd Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 12 May 2025 14:43:35 +0000 Subject: [PATCH 7/9] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20.gitea/workflows/test-flight-cd.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test-flight-cd.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitea/workflows/test-flight-cd.yaml b/.gitea/workflows/test-flight-cd.yaml index 5d7e74ae..60fe9d9d 100644 --- a/.gitea/workflows/test-flight-cd.yaml +++ b/.gitea/workflows/test-flight-cd.yaml @@ -11,6 +11,12 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Unlock login keychain + run: | + security unlock-keychain -p "$KEYCHAIN_PASSWORD" /Users/runner/Library/Keychains/login.keychain-db + env: + KEYCHAIN_PASSWORD: EeChahboo9Ei + - name: Flutter build run: | flutter clean From 592919600455428b6f5f47fead14851950e5ad23 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 12 May 2025 14:44:17 +0000 Subject: [PATCH 8/9] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20.gitea/workflows/test-flight-cd.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test-flight-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test-flight-cd.yaml b/.gitea/workflows/test-flight-cd.yaml index 60fe9d9d..fd22ac2f 100644 --- a/.gitea/workflows/test-flight-cd.yaml +++ b/.gitea/workflows/test-flight-cd.yaml @@ -13,7 +13,7 @@ jobs: - name: Unlock login keychain run: | - security unlock-keychain -p "$KEYCHAIN_PASSWORD" /Users/runner/Library/Keychains/login.keychain-db + security unlock-keychain -p "$KEYCHAIN_PASSWORD" /Users/gitea_runner_ci/Library/Keychains/login.keychain-db env: KEYCHAIN_PASSWORD: EeChahboo9Ei From ef53ad45d6841f25d06ebff4313a03ee2c49d5aa Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 12 May 2025 14:44:44 +0000 Subject: [PATCH 9/9] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20ios/fastlane/Fastfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 4c53abd3..4073b355 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -20,7 +20,7 @@ platform :ios do lane :beta do match(type: "appstore") increment_build_number(xcodeproj: "Runner.xcodeproj") - build_app(workspace: "Runner.xcworkspace", scheme: "Runner", export_method: "app-store") + build_app(workspace: "Runner.xcworkspace", scheme: "Runner", export_method: "app-store", codesigning_identity: "Apple Distribution") upload_to_testflight end end