|
|
|
@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m
|
|
|
|
import 'package:doctor_app_flutter/core/service/authentication_service.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/service/authentication_service.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/locator.dart';
|
|
|
|
import 'package:doctor_app_flutter/locator.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
|
|
|
|
@ -29,6 +30,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:local_auth/auth_strings.dart';
|
|
|
|
import 'package:local_auth/auth_strings.dart';
|
|
|
|
import 'package:local_auth/local_auth.dart';
|
|
|
|
import 'package:local_auth/local_auth.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED }
|
|
|
|
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED }
|
|
|
|
|
|
|
|
|
|
|
|
@ -237,19 +239,6 @@ class AuthenticationViewModel extends BaseViewModel {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getInitUserInfo()async{
|
|
|
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
|
|
|
var localLoggedUser = await sharedPref.getObj(LOGGED_IN_USER);
|
|
|
|
|
|
|
|
if(localLoggedUser!= null) {
|
|
|
|
|
|
|
|
loggedUser = NewLoginInformationModel.fromJson(localLoggedUser);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var lastLogin = await sharedPref.getObj(LAST_LOGIN_USER);
|
|
|
|
|
|
|
|
if (lastLogin != null) {
|
|
|
|
|
|
|
|
user = GetIMEIDetailsModel.fromJson(lastLogin);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setDataAfterSendActivationSuccsess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) {
|
|
|
|
setDataAfterSendActivationSuccsess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) {
|
|
|
|
print("VerificationCode : " +
|
|
|
|
print("VerificationCode : " +
|
|
|
|
sendActivationCodeForDoctorAppResponseModel.verificationCode);
|
|
|
|
sendActivationCodeForDoctorAppResponseModel.verificationCode);
|
|
|
|
@ -353,7 +342,7 @@ class AuthenticationViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
|
|
|
|
|
|
|
_firebaseMessaging.getToken().then((String token) async {
|
|
|
|
_firebaseMessaging.getToken().then((String token) async {
|
|
|
|
if (DEVICE_TOKEN == "" && !isLogin) {
|
|
|
|
if (DEVICE_TOKEN == "" && !ProjectViewModel().isLogin) {
|
|
|
|
DEVICE_TOKEN = token;
|
|
|
|
DEVICE_TOKEN = token;
|
|
|
|
|
|
|
|
|
|
|
|
await _authService.selectDeviceImei(DEVICE_TOKEN);
|
|
|
|
await _authService.selectDeviceImei(DEVICE_TOKEN);
|
|
|
|
|