Implemented home creation and add counter to the sign up screen

This commit is contained in:
Abdullah Alassaf
2024-06-03 00:26:07 +03:00
parent 9877dde78e
commit 6a9c2967d2
12 changed files with 577 additions and 13 deletions
+10 -4
View File
@@ -9,7 +9,6 @@ import 'package:syncrow_app/features/auth/model/user_model.dart';
import 'package:syncrow_app/navigation/navigation_service.dart';
import 'package:syncrow_app/navigation/routing_constants.dart';
import 'package:syncrow_app/services/api/authentication_api.dart';
part 'auth_state.dart';
class AuthCubit extends Cubit<AuthState> {
@@ -202,15 +201,22 @@ class AuthCubit extends Cubit<AuthState> {
sendOtp() async {
try {
final response =
await AuthenticationAPI.sendOtp(body: {'email': email, 'type': 'VERIFICATION'});
// otpCode = response['otp'];
await AuthenticationAPI.sendOtp(body: {'email': email, 'type': 'VERIFICATION'});
emit(AuthSignUpSuccess());
} catch (_) {
emit(AuthLoginError(message: 'Something went wrong'));
}
}
reSendOtp() async {
try {
await AuthenticationAPI.sendOtp(body: {'email': email, 'type': 'VERIFICATION'});
emit(ResendOtpSuccess());
} catch (_) {
emit(AuthLoginError(message: 'Something went wrong'));
}
}
verifyOtp() async {
emit(AuthLoginLoading());
try {
+2
View File
@@ -24,6 +24,8 @@ class AuthOtpSuccess extends AuthSuccess {}
class AuthSignUpSuccess extends AuthSuccess {}
class ResendOtpSuccess extends AuthSuccess {}
class AuthLoginError extends AuthError {
AuthLoginError({required super.message, super.code});
}