From 87bf277248342c7a1add45f09562e6bb36aae2a5 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Thu, 26 Jun 2025 15:49:06 +0300 Subject: [PATCH 1/3] feat(chat): add refresh in chats screen --- .../chat/presentation/pages/chats_screen.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/features/chat/presentation/pages/chats_screen.dart b/lib/features/chat/presentation/pages/chats_screen.dart index 03c3870a..6c4c2398 100644 --- a/lib/features/chat/presentation/pages/chats_screen.dart +++ b/lib/features/chat/presentation/pages/chats_screen.dart @@ -67,11 +67,16 @@ class _ChatsScreenState extends State { ), ]; }, - body: switch (state.state) { - BaseState.error => DataErrorWidget(onReload: () => context.read().getChatRooms()), - BaseState.success => _buildChatList(context, state), - _ => const Loader(), - }, + body: RefreshIndicator( + child: switch (state.state) { + BaseState.error => DataErrorWidget(onReload: () => context.read().getChatRooms()), + BaseState.success => _buildChatList(context, state), + _ => const Loader(), + }, + onRefresh: () async { + await context.read().getChatRooms(); + }, + ), ), ); }, From 9946abc0be5b933b77a7193beeb7ae98647a5f9b Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Thu, 26 Jun 2025 16:10:34 +0300 Subject: [PATCH 2/3] feat(chat): add refresh when new message --- lib/core/websockets/ws_manager.dart | 8 ++++++++ .../bloc/chat_room_cubit/chat_room_cubit.dart | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/lib/core/websockets/ws_manager.dart b/lib/core/websockets/ws_manager.dart index 152f0fb9..73431542 100644 --- a/lib/core/websockets/ws_manager.dart +++ b/lib/core/websockets/ws_manager.dart @@ -1,9 +1,12 @@ import 'dart:developer'; import 'package:dart_pusher_channels/dart_pusher_channels.dart'; +import 'package:easy_debounce/easy_debounce.dart'; import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/locator_service.dart'; import 'package:eatvio_app/core/websockets/ws_service.dart'; import 'package:eatvio_app/core/token_storage.dart'; +import 'package:eatvio_app/features/chat/presentation/bloc/chats_cubit/chats_cubit.dart'; class WsManager { final WsService wsService; @@ -71,6 +74,11 @@ class WsManager { } }); client?.eventStream.listen((event) { + EasyDebounce.debounce( + 'searchChatRoom', + const Duration(milliseconds: 300), + () => sl().getChatRooms(), + ); log(event.rootObject.toString()); }); _subscribe(); diff --git a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart index 369993e0..39df041b 100644 --- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart +++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart @@ -7,11 +7,13 @@ import 'package:audioplayers/audioplayers.dart'; import 'package:dart_pusher_channels/dart_pusher_channels.dart'; import 'package:easy_debounce/easy_debounce.dart'; import 'package:eatvio_app/core/image_compressing/image_compress_utility.dart'; +import 'package:eatvio_app/core/locator_service.dart'; import 'package:eatvio_app/core/utils/date_time_utils.dart'; import 'package:eatvio_app/core/websockets/ws_manager.dart'; import 'package:eatvio_app/features/chat/models/chat_message_model.dart'; import 'package:eatvio_app/features/chat/models/plan_complain_model.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.dart'; +import 'package:eatvio_app/features/chat/presentation/bloc/chats_cubit/chats_cubit.dart'; import 'package:eatvio_app/features/chat/repositories/chat_repository.dart'; import 'package:eatvio_app/features/my_finance/models/card_model.dart'; import 'package:eatvio_app/features/my_finance/repositories/cards_repository.dart'; @@ -167,6 +169,11 @@ class ChatRoomCubit extends Cubit { List messagesList = [message, ...(state as ChatRoomStateLoaded).chatMessages]; chatRepository.emitNewMessageToChats(message); emit((state as ChatRoomStateLoaded).copyWith(chatMessages: messagesList, isLoading: isLoading)); + EasyDebounce.debounce( + 'searchChatRoom', + const Duration(milliseconds: 300), + () => sl().getChatRooms(), + ); }); typingSubscription = wsManager.clientTypingStream?.listen((event) { From c103d214c4efebc5201d6c74d0256e3e0d03ba10 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Thu, 26 Jun 2025 16:11:31 +0300 Subject: [PATCH 3/3] feat(testflight): new version --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- ios/Runner/Info.plist | 2 +- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index d38fc84e..08e122ba 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -388,7 +388,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 32; + CURRENT_PROJECT_VERSION = 33; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -538,7 +538,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 32; + CURRENT_PROJECT_VERSION = 33; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -576,7 +576,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 32; + CURRENT_PROJECT_VERSION = 33; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 83272a6a..219c1ec3 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 32 + 33 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/pubspec.yaml b/pubspec.yaml index dc39773a..8ba374ec 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: eatvio_app description: A new Flutter project. -version: 1.1.9+39 +version: 1.1.10+40 publish_to: 'none' environment: