return login

merge-requests/209/head
Mohammad Aljammal 5 years ago
parent 33bb7dd652
commit 93c0bdf32a

@ -36,21 +36,20 @@ class BaseAppClient {
}) async {
String url = BASE_URL + endPoint;
try {
//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 ?? '';
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 ?? '';
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
@ -64,11 +63,9 @@ class BaseAppClient {
body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = 0; // PATIENT_OUT_SA;
body['VidaAuthTokenID'] =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWV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iwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU";
//await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
print("URL : $url");
print("Body : ${json.encode(body)}");

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

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

Loading…
Cancel
Save