@ -57,7 +57,8 @@ class AuthenticationViewModel extends ChangeNotifier {
required NavigationService navigationService ,
required NavigationService navigationService ,
required CacheService cacheService ,
required CacheService cacheService ,
required LocalAuthService localAuthService ,
required LocalAuthService localAuthService ,
} ) : _navigationService = navigationService ,
} )
: _navigationService = navigationService ,
_dialogService = dialogService ,
_dialogService = dialogService ,
_errorHandlerService = errorHandlerService ,
_errorHandlerService = errorHandlerService ,
_appState = appState ,
_appState = appState ,
@ -298,7 +299,8 @@ class AuthenticationViewModel extends ChangeNotifier {
final result = await _authenticationRepo . checkPatientAuthentication ( checkPatientAuthenticationReq: checkPatientAuthenticationReq ) ;
final result = await _authenticationRepo . checkPatientAuthentication ( checkPatientAuthenticationReq: checkPatientAuthenticationReq ) ;
result . fold (
result . fold (
( failure ) async = > await _errorHandlerService . handleError (
( failure ) async = >
await _errorHandlerService . handleError (
failure: failure ,
failure: failure ,
onUnHandledFailure: ( failure ) async {
onUnHandledFailure: ( failure ) async {
LoaderBottomSheet . hideLoader ( ) ;
LoaderBottomSheet . hideLoader ( ) ;
@ -441,7 +443,8 @@ class AuthenticationViewModel extends ChangeNotifier {
LoaderBottomSheet . hideLoader ( ) ;
LoaderBottomSheet . hideLoader ( ) ;
resultEither . fold (
resultEither . fold (
( failure ) async = > await _errorHandlerService . handleError (
( failure ) async = >
await _errorHandlerService . handleError (
failure: failure ,
failure: failure ,
onUnHandledFailure: ( failure ) async {
onUnHandledFailure: ( failure ) async {
LoaderBottomSheet . hideLoader ( ) ;
LoaderBottomSheet . hideLoader ( ) ;
@ -468,7 +471,8 @@ class AuthenticationViewModel extends ChangeNotifier {
final resultEither = await _authenticationRepo . checkActivationCodeRepo ( newRequest: CheckActivationCodeRegisterReq . fromJson ( request ) , activationCode: activationCode , isRegister: false ) ;
final resultEither = await _authenticationRepo . checkActivationCodeRepo ( newRequest: CheckActivationCodeRegisterReq . fromJson ( request ) , activationCode: activationCode , isRegister: false ) ;
resultEither . fold (
resultEither . fold (
( failure ) async = > await _errorHandlerService . handleError (
( failure ) async = >
await _errorHandlerService . handleError (
failure: failure ,
failure: failure ,
onUnHandledFailure: ( failure ) async {
onUnHandledFailure: ( failure ) async {
LoaderBottomSheet . hideLoader ( ) ;
LoaderBottomSheet . hideLoader ( ) ;
@ -878,7 +882,7 @@ class AuthenticationViewModel extends ChangeNotifier {
message: apiResponse . errorMessage ? ? " " ,
message: apiResponse . errorMessage ? ? " " ,
label: LocaleKeys . notice . tr ( ) ,
label: LocaleKeys . notice . tr ( ) ,
onOkPressed: ( ) {
onOkPressed: ( ) {
_dialogService . showPhoneNumberPickerSheet ( onSMSPress: ( ) {
_dialogService . showPhoneNumberPickerSheet ( label:" Where would you like to receive OTP? " , message: " Please select from the below options to receive OTP. " , onSMSPress: ( ) {
checkUserAuthentication ( otpTypeEnum: OTPTypeEnum . sms ) ;
checkUserAuthentication ( otpTypeEnum: OTPTypeEnum . sms ) ;
} , onWhatsappPress: ( ) {
} , onWhatsappPress: ( ) {
checkUserAuthentication ( otpTypeEnum: OTPTypeEnum . whatsapp ) ;
checkUserAuthentication ( otpTypeEnum: OTPTypeEnum . whatsapp ) ;