hack login

merge-requests/202/head
Mohammad Aljammal 5 years ago
parent 2f273dcde8
commit 04ed76069c

@ -36,20 +36,21 @@ class BaseAppClient {
}) async {
String url = BASE_URL + endPoint;
try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null)
body['DoctorID'] = doctorProfile?.doctorID;
body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID;
}
if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID;
}
body['TokenID'] = token ?? '';
//TODO change it edit By Jammal
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// String token = await sharedPref.getString(TOKEN);
// if (profile != null) {
// DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
// if (body['DoctorID'] == null)
body['DoctorID'] = 4709;//doctorProfile?.doctorID;
body['EditedBy'] = 4709;//doctorProfile?.doctorID;
//if (body['ProjectID'] == null) {
body['ProjectID'] = 15;//doctorProfile?.projectID;
// }
// if (body['ClinicID'] == null)
body['ClinicID'] = 1;//doctorProfile?.clinicID;
// }
body['TokenID'] = "@dm!n";//token ?? '';
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
@ -63,9 +64,10 @@ class BaseAppClient {
body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = 0; // PATIENT_OUT_SA;
body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
body['VidaRefreshTokenID'] =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiND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jaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU";
//await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
print("URL : $url");
print("Body : ${json.encode(body)}");

@ -101,7 +101,7 @@ class ProjectViewModel with ChangeNotifier {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: {});
}, body: Map());
return Future.value(localRes);
} catch (error) {
@ -111,18 +111,18 @@ class ProjectViewModel with ChangeNotifier {
}
void getProfile() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: doctorProfile.doctorID,
clinicID: doctorProfile.clinicID,
license: true,
projectID: doctorProfile.projectID,
tokenID: '',
languageID: 2);
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
// ProfileReqModel docInfo = new ProfileReqModel(
// doctorID: doctorProfile.doctorID,
// clinicID: doctorProfile.clinicID,
// license: true,
// projectID: doctorProfile.projectID,
// tokenID: '',
// languageID: 2);
Provider.of<AuthViewModel>(AppGlobal.CONTEX, listen: false)
.getDocProfiles(docInfo.toJson())
.getDocProfiles(ProfileReqModel().toJson())
.then((res) async {
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
}).catchError((err) {

@ -22,7 +22,7 @@ class RootPage extends StatelessWidget {
);
break;
case APP_STATUS.UNAUTHENTICATED:
return Loginsreen();
return LandingPage();
break;
case APP_STATUS.AUTHENTICATED:
return LandingPage();

@ -115,68 +115,69 @@ class _DashboardScreenState extends State<DashboardScreen> {
SizedBox(
height: 4,
),
InkWell(
onTap: () async {
showCupertinoPicker(
decKey: '',
context: context,
actionList: projectsProvider
.doctorClinicsList);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
child: AppText(
authProvider.selectedClinicName !=
null
? authProvider
.selectedClinicName
: authProvider.doctorProfile
.clinicDescription,
fontSize:
SizeConfig.textMultiplier *
1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
alignment: projectsProvider.isArabic
? Alignment.topRight
: Alignment.topLeft,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
InkWell(
child: Container(
margin: EdgeInsets.only(
left: 5,
top: projectsProvider
.isArabic
? 0
: 5,
right: 10,
bottom: projectsProvider
.isArabic
? 15
: 7),
child: Icon(
DoctorApp.sync_icon,
color: Colors.white,
size: SizeConfig
.textMultiplier *
1.8,
)),
),
],
),
]),
),
//TODO change it edit By Jammal
// InkWell(
// onTap: () async {
// showCupertinoPicker(
// decKey: '',
// context: context,
// actionList: projectsProvider
// .doctorClinicsList);
// },
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: <Widget>[
// Container(
// child: AppText(
// authProvider.selectedClinicName !=
// null
// ? authProvider
// .selectedClinicName
// : authProvider.doctorProfile
// .clinicDescription,
// fontSize:
// SizeConfig.textMultiplier *
// 1.7,
// color: Colors.white,
// textAlign: TextAlign.center,
// ),
// alignment: projectsProvider.isArabic
// ? Alignment.topRight
// : Alignment.topLeft,
// ),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.max,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// InkWell(
// child: Container(
// margin: EdgeInsets.only(
// left: 5,
// top: projectsProvider
// .isArabic
// ? 0
// : 5,
// right: 10,
// bottom: projectsProvider
// .isArabic
// ? 15
// : 7),
// child: Icon(
// DoctorApp.sync_icon,
// color: Colors.white,
// size: SizeConfig
// .textMultiplier *
// 1.8,
// )),
// ),
// ],
// ),
// ]),
// ),
],
),
]),

@ -43,7 +43,8 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
'Dr. ${authProvider.doctorProfile.doctorName}',
//TODO change it edit By Jammal
'Dr. ',//${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.white,
@ -71,7 +72,9 @@ final double height;
height: 50,
width: 60,
child: Image.network(
authProvider.doctorProfile.doctorImageURL,
//TODO change it edit By Jammal
'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg'
// authProvider.doctorProfile.doctorImageURL,
// fit: BoxFit.fill,
),
),

Loading…
Cancel
Save