hack login

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

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

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

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

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

@ -43,7 +43,8 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'Dr. ${authProvider.doctorProfile.doctorName}', //TODO change it edit By Jammal
'Dr. ',//${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.white, color: Colors.white,
@ -71,7 +72,9 @@ final double height;
height: 50, height: 50,
width: 60, width: 60,
child: Image.network( 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, // fit: BoxFit.fill,
), ),
), ),

Loading…
Cancel
Save