mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 09:37:56 +00:00
Implemented home creation and add counter to the sign up screen
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user