forked from eatvio/eatvio_app
feat(order info): added order info screen
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:eatvio_app/core/app_router.dart';
|
||||
import 'package:eatvio_app/core/token_storage.dart';
|
||||
import 'package:eatvio_app/core/utils/toasts.dart';
|
||||
@@ -11,10 +13,10 @@ class AuthCubit extends Cubit<AuthState> {
|
||||
|
||||
AuthCubit({
|
||||
required this.authRepository,
|
||||
}) : super(AuthState());
|
||||
}) : super(const AuthState());
|
||||
|
||||
Future<bool> getTokenByCredentials(String email, String password) async {
|
||||
emit(AuthState.loading());
|
||||
emit(const AuthState.loading());
|
||||
try {
|
||||
final token = (await authRepository.getTokenByCredentials(
|
||||
email,
|
||||
@@ -31,7 +33,7 @@ class AuthCubit extends Cubit<AuthState> {
|
||||
AppRouter.navigatorKey.currentContext?.go('/my-profile-screen');
|
||||
return true;
|
||||
} catch (e) {
|
||||
print(e);
|
||||
log(e.toString());
|
||||
showErrorToast('Неверный адрес электронной почты или пароль');
|
||||
emit(AuthState.error(errorMessage: '$e'));
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user