forked from eatvio/eatvio_app
feat(email): add alert for phone verify and email verify after registration
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:eatvio_app/core/app_router.dart';
|
||||
import 'package:eatvio_app/core/locator_service.dart';
|
||||
import 'package:eatvio_app/core/widgets/show_error_dialog.dart';
|
||||
import 'package:eatvio_app/features/profile/repositories/profile_repository.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
@@ -13,6 +14,8 @@ class PhoneVerifyErrorInterceptor extends Interceptor {
|
||||
if (data is Map<String, dynamic> && data['type'] == 'unverificated_phone') {
|
||||
final String phone = await sl<ProfileRepository>().getMyPhone();
|
||||
final String passKey = await sl<ProfileRepository>().getPassKey(phone);
|
||||
await showErrorDialog(AppRouter.navigatorKey.currentContext!,
|
||||
title: 'Привяжите номер телефона', description: 'Для того, что бы выполнить это действие необходимо привязать номер телефона');
|
||||
AppRouter.navigatorKey.currentContext?.pushNamed('verifyScreen', extra: passKey);
|
||||
return handler.reject(
|
||||
DioException(
|
||||
|
||||
@@ -58,7 +58,6 @@ class MenuScreen extends StatelessWidget {
|
||||
),
|
||||
_divider(context),
|
||||
_tile(leading: ImageConstant.icnExit, title: 'Выход', onTap: _onTapLogout(context)),
|
||||
_tile(leading: ImageConstant.icnExit, title: 'Verify email', onTap: () => GoRouter.of(context).pushNamed('verifyEmailScreen')),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -59,6 +59,7 @@ class RegistrationCubit extends Cubit<RegistrationState> {
|
||||
);
|
||||
await TokenStorage.saveTokenInStorage(token);
|
||||
AppRouter.navigatorKey.currentContext?.go('/feed-screen');
|
||||
AppRouter.navigatorKey.currentContext?.goNamed('verifyEmailScreen');
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user