diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index e6a8ab5e..d38fc84e 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 = 31;
+ CURRENT_PROJECT_VERSION = 32;
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 = 31;
+ CURRENT_PROJECT_VERSION = 32;
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 = 31;
+ CURRENT_PROJECT_VERSION = 32;
DEVELOPMENT_TEAM = VL68C36HYS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 71ddffdc..83272a6a 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -21,7 +21,7 @@
CFBundleSignature
????
CFBundleVersion
- 31
+ 32
ITSAppUsesNonExemptEncryption
LSRequiresIPhoneOS
diff --git a/lib/features/auth/presentation/pages/auth_screen.dart b/lib/features/auth/presentation/pages/auth_screen.dart
index 877aaf1a..31028059 100644
--- a/lib/features/auth/presentation/pages/auth_screen.dart
+++ b/lib/features/auth/presentation/pages/auth_screen.dart
@@ -1,4 +1,5 @@
import 'dart:async';
+import 'package:eatvio_app/core/app_router.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';
@@ -60,17 +61,20 @@ class _AuthScreenState extends State {
}
if (context.mounted) {
try {
- context.read().getMyProfile();
- context.read().getChatRoomsWithLoading();
- context.read().connectToWebSocket();
- context.read().getNotifications();
- context.read().connectToWebSocket();
+ await sl().getMyProfile();
+ await sl().getChatRoomsWithLoading();
+ await sl().connectToWebSocket();
+ await sl().getNotifications();
+ await sl().connectToWebSocket();
showSuccessToast('Успешный вход');
} catch (e) {
rethrow;
}
- GoRouter.of(context).go('/feed-screen', extra: {'needToInitializeWebSocket': false});
}
+ AppRouter.navigatorKey.currentContext?.go(
+ '/feed-screen',
+ extra: {'needToInitializeWebSocket': false},
+ );
}
@override
diff --git a/lib/features/auth/presentation/pages/scan_qr_code_screen.dart b/lib/features/auth/presentation/pages/scan_qr_code_screen.dart
index 35f56b50..411cb3a5 100644
--- a/lib/features/auth/presentation/pages/scan_qr_code_screen.dart
+++ b/lib/features/auth/presentation/pages/scan_qr_code_screen.dart
@@ -6,6 +6,10 @@ import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/locator_service.dart';
import 'package:eatvio_app/core/token_storage.dart';
import 'package:eatvio_app/core/utils/toasts.dart';
+import 'package:eatvio_app/core/websockets/ws_manager.dart';
+import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart';
+import 'package:eatvio_app/features/chat/presentation/bloc/chats_cubit/chats_cubit.dart';
+import 'package:eatvio_app/features/notifications/presentation/notifications_cubit/notifications_cubit.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:qr_code_scanner_plus/qr_code_scanner_plus.dart';
@@ -58,7 +62,7 @@ class _ScanQRCodeScreenState extends State {
setState(() {
result = scanData;
});
- controller.pauseCamera();
+ await controller.pauseCamera();
try {
final scannedUrl = scanData.code;
final uri = Uri.parse(scannedUrl ?? '');
@@ -76,14 +80,29 @@ class _ScanQRCodeScreenState extends State {
);
final token = response.data['token'];
await TokenStorage.saveTokenInStorage(token);
+ try {
+ await sl().clear();
+ await sl().initialize();
+ } catch (e) {
+ rethrow;
+ }
+ try {
+ await sl().getMyProfile();
+ await sl().getChatRoomsWithLoading();
+ await sl().connectToWebSocket();
+ await sl().getNotifications();
+ await sl().connectToWebSocket();
+ } catch (e) {
+ rethrow;
+ }
AppRouter.navigatorKey.currentContext?.go(
'/feed-screen',
extra: {'needToInitializeWebSocket': false},
);
showSuccessToast('Добро пожаловать!');
} catch (e) {
- controller.resumeCamera();
- showErrorToast('Что-то пошло не так, попробуйте обновить страницу с qr кодом или используйте вход через логин и пароль');
+ await controller.resumeCamera();
+ showErrorToast('Что-то пошло не так. Попробуйте обновить страницу с QR-кодом или войдите с помощью логина и пароля.');
}
});
}
diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart
index ae45a6ca..94ae4601 100644
--- a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart
+++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart
@@ -1,6 +1,8 @@
+import 'package:eatvio_app/core/app_router.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart';
import 'package:eatvio_app/features/profile/repositories/profile_repository.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
class ProfileAvatarCubit extends Cubit {
final ProfileRepository profileRepository;
@@ -18,6 +20,7 @@ class ProfileAvatarCubit extends Cubit {
),
);
} catch (e) {
+ AppRouter.navigatorKey.currentContext?.go('/auth-screen');
emit(ProfileAvatarState.error(errorMessage: e.toString()));
}
}
diff --git a/lib/features/menu/presentation/pages/menu_screen.dart b/lib/features/menu/presentation/pages/menu_screen.dart
index f657c6a7..c8fa2135 100644
--- a/lib/features/menu/presentation/pages/menu_screen.dart
+++ b/lib/features/menu/presentation/pages/menu_screen.dart
@@ -114,7 +114,7 @@ class MenuScreen extends StatelessWidget {
child: const Text("Отмена"),
),
],
- content: const Text("Вы уверены что хотите выйти из аккаунта?"),
+ content: const Text("Вы уверены, что хотите выйти из аккаунта?"),
),
);
};
diff --git a/lib/main.dart b/lib/main.dart
index a712f6e3..005afaac 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -27,7 +27,7 @@ Future main() async {
await di.init();
await SentryFlutter.init(
- (options) {
+ (options) {
options.dsn = 'http://ba7f2653067776f3034e6e89850e85a1@sentry.md-desk.ru:9000/2';
options.tracesSampleRate = 1.0;
options.debug = false;
diff --git a/pubspec.yaml b/pubspec.yaml
index 9e4ef5af..dc39773a 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: eatvio_app
description: A new Flutter project.
-version: 1.1.8+38
+version: 1.1.9+39
publish_to: 'none'
environment: