Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into fix_login

 Conflicts:
	lib/pages/login/confirm-login.dart
	lib/pages/login/login.dart
merge-update-with-lab-changes
Mohammad Aljmma 5 years ago
commit a796e0392b

@ -361,7 +361,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
this.getMobileInfo(request); this.getMobileInfo(request);
} }
} }
var asd = "";
} }
getMobileInfo(request) { getMobileInfo(request) {
@ -408,7 +407,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
print(err); print(err);
}).showProgressBar( }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
;
} }
setUser() async {} setUser() async {}

@ -1,4 +1,7 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
@ -15,7 +18,7 @@ class ForgotPassword extends StatefulWidget {
class _ForgotPassword extends State<ForgotPassword> { class _ForgotPassword extends State<ForgotPassword> {
String selectedType = 'Saudi Arabia'; String selectedType = 'Saudi Arabia';
final TextEditingController nationalIDorFile = null; final TextEditingController nationalIDorFile = null;
final TextEditingController mobileNo = null; final TextEditingController mobileNo = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -84,7 +87,10 @@ class _ForgotPassword extends State<ForgotPassword> {
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).submit, TranslationBase.of(context).submit,
() => {}, () {
sendPatientIDBySMS();
// print(mobileNo.text);
},
)), )),
], ],
), ),
@ -93,4 +99,21 @@ class _ForgotPassword extends State<ForgotPassword> {
]), ]),
))); )));
} }
sendPatientIDBySMS() {
GifLoaderDialogUtils.showMyDialog(context);
final authService = new AuthProvider();
authService.sendPatientIDSMS(mobileNo.text, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
} }

@ -11,6 +11,8 @@ import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doct
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -18,12 +20,10 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class Login extends StatefulWidget { class Login extends StatefulWidget {
@override @override
@ -154,6 +154,7 @@ class _Login extends State<Login> {
checkUserAuthentication() { checkUserAuthentication() {
// showLoader(true); // showLoader(true);
GifLoaderDialogUtils.showMyDialog(context);
var request = CheckPatientAuthenticationReq(); var request = CheckPatientAuthenticationReq();
request.isRegister = false; request.isRegister = false;
request.patientMobileNumber = int.parse(mobileNo); request.patientMobileNumber = int.parse(mobileNo);
@ -172,7 +173,7 @@ class _Login extends State<Login> {
authService authService
.checkPatientAuthentication(request) .checkPatientAuthentication(request)
.then((value) => { .then((value) => {
//showLoader(false), //showLoader(false),GifLoaderDialogUtils.hideDialog(context),
if (value['isSMSSent']) if (value['isSMSSent'])
{ {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
@ -184,12 +185,16 @@ class _Login extends State<Login> {
{ {
if (value['IsAuthenticated']) {this.checkActivationCode()} if (value['IsAuthenticated']) {this.checkActivationCode()}
} }
}) })
.catchError((err) { .catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
// SMSOTP.showLoadingDialog(context, false), // SMSOTP.showLoadingDialog(context, false),
AppToast.showErrorToast(message: err);
});
} }
checkActivationCode({code}) async { checkActivationCode({code}) async {
@ -249,9 +254,9 @@ class _Login extends State<Login> {
}); });
} }
// showLoader(bool isTrue) { // showLoader(bool isTrue) {
// setState(() { // setState(() {
// isLoading = isTrue; // isLoading = isTrue;
// }); // });
// } // }
} }

@ -1,17 +1,11 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -28,9 +22,12 @@ class _RegisterInfo extends State<RegisterInfo> {
RegisterInfoResponse registerInfo; RegisterInfoResponse registerInfo;
bool isLoading; bool isLoading;
int page = 1; int page = 1;
@override @override
void initState() { void initState() {
getRegisterInfo(); WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getRegisterInfo();
});
super.initState(); super.initState();
} }
@ -146,10 +143,15 @@ class _RegisterInfo extends State<RegisterInfo> {
} }
registerNow() {} registerNow() {}
getRegisterInfo() async { getRegisterInfo() async {
RegisterInfoResponse registerInfo;
registerInfo = registerInfo =
RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA));
setState(() {
this.registerInfo = registerInfo;
});
print(await sharedPref.getObject(NHIC_DATA)); print(this.registerInfo);
} }
} }

@ -1,43 +1,29 @@
import 'dart:math';
import 'package:badges/badges.dart'; import 'package:badges/badges.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart';
import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_widget.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../locator.dart';
import 'active_medications/ActiveMedicationsPage.dart';
import 'allergies_page.dart'; import 'allergies_page.dart';
import 'ask_doctor/ask_doctor_home_page.dart';
import 'balance/my_balance_page.dart';
import 'doctor/doctor_home_page.dart'; import 'doctor/doctor_home_page.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'eye/EyeHomePage.dart';
import 'eye/EyeMeasurementsPage.dart';
import 'labs/labs_home_page.dart'; import 'labs/labs_home_page.dart';
import 'my_trackers/my_trackers.dart';
class MedicalProfilePage extends StatefulWidget { class MedicalProfilePage extends StatefulWidget {
@override @override
@ -45,6 +31,8 @@ class MedicalProfilePage extends StatefulWidget {
} }
class _MedicalProfilePageState extends State<MedicalProfilePage> { class _MedicalProfilePageState extends State<MedicalProfilePage> {
var authProvider = new AuthProvider();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -73,18 +61,19 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
width: double.infinity, width: double.infinity,
// color: Colors.black.withOpacity(0.0) // color: Colors.black.withOpacity(0.0)
), ),
if(model.authenticatedUserObject.isLogin) if (model.authenticatedUserObject.isLogin)
ListView.builder( ListView.builder(
itemBuilder: (context, index) => TimeLineWidget( itemBuilder: (context, index) =>
isUp: index % 2 == 1, TimeLineWidget(
appoitmentAllHistoryResul: model isUp: index % 2 == 1,
.appoitmentAllHistoryResultList[index], appoitmentAllHistoryResul: model
.appoitmentAllHistoryResultList[index],
),
itemCount: model
.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal,
reverse: !projectViewModel.isArabic,
), ),
itemCount:
model.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal,
reverse: !projectViewModel.isArabic,
),
], ],
), ),
), ),
@ -109,34 +98,53 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
), ),
); );
}, },
child: Stack( child: authProvider.isLogin
children: [ ? Stack(children: [
MedicalProfileItem( MedicalProfileItem(
title: TranslationBase.of(context) title:
.myAppointments, TranslationBase.of(context)
imagePath: 'my_appointment_icon.png', .myAppointments,
subTitle: TranslationBase.of(context) imagePath:
.myAppointmentsList, 'my_appointment_icon.png',
hasBadge: true, subTitle:
), TranslationBase.of(context)
Positioned( .myAppointmentsList,
right: 0.0, hasBadge: true,
child: Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: Color(0xFF40ACC9).withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(appoCountProvider.count.toString(),
style: TextStyle(
color: Colors.white, fontSize: 16.0)),
), ),
Positioned(
right: 0.0,
child: Badge(
toAnimate: false,
position:
BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: Color(0xFF40ACC9)
.withOpacity(1.0),
borderRadius:
BorderRadius.circular(8),
badgeContent: Container(
padding:
EdgeInsets.all(2.0),
child: Text(
appoCountProvider.count
.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 16.0)),
),
),
),
])
: MedicalProfileItem(
title: TranslationBase.of(context)
.myAppointments,
imagePath:
'my_appointment_icon.png',
subTitle:
TranslationBase.of(context)
.myAppointmentsList,
hasBadge: true,
), ),
),
]
),
), ),
), ),
Expanded( Expanded(
@ -233,9 +241,11 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap:()=> Navigator.push(context, FadePage(page: AllergiesPage())) , onTap: () => Navigator.push(context,
FadePage(page: AllergiesPage())),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).allergies, title: TranslationBase.of(context)
.allergies,
imagePath: 'my_allergies_icon.png', imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.allergiesSubtitle, .allergiesSubtitle,
@ -263,13 +273,16 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(
FadePage(page: InsuranceApproval())); context,
FadePage(
page: InsuranceApproval()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context)
.insuranceApproval, .insuranceApproval,
imagePath: 'insurance_approvals_icon.png', imagePath:
'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.insuranceApprovalSubtitle, .insuranceApprovalSubtitle,
), ),
@ -287,18 +300,24 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: title:
TranslationBase.of(context).medical, TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png', imagePath: 'medical_reports_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.medicalSubtitle, .medicalSubtitle,
), ),
), ),
), ),
Expanded(child: Container(),), Expanded(
Expanded(child: Container(),), child: Container(),
),
Expanded(
child: Container(),
),
]), ]),
SizedBox(
SizedBox(height: MediaQuery.of(context).size.height * 0.12,) height:
MediaQuery.of(context).size.height * 0.12,
)
], ],
), ),
) )
@ -337,7 +356,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
color: Colors.white, color: Colors.white,
bold: true, bold: true,
), ),
Texts( Texts(
'${model.user.patientID}', '${model.user.patientID}',
color: Colors.white, color: Colors.white,

@ -1,17 +1,18 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart'; import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart';
import 'package:diplomaticquarterapp/models/Authentication/insert_device_imei_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/insert_device_imei_request.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Authentication/registered_authenticated_user_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/registered_authenticated_user_req.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -19,7 +20,9 @@ import '../../locator.dart';
// SharedPreferences sharedPref = new SharedPreferences(); // SharedPreferences sharedPref = new SharedPreferences();
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
const String INSERT_DEVICE_IMEI = const String INSERT_DEVICE_IMEI =
'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI'; 'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI';
@ -40,11 +43,15 @@ const REGISTER_USER = 'Services/Authentication.svc/REST/PatientRegistration';
const LOGGED_IN_USER_URL = const LOGGED_IN_USER_URL =
'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo'; 'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo';
const FORGOT_PATIENT_ID =
'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
class AuthProvider with ChangeNotifier { class AuthProvider with ChangeNotifier {
bool isLogin = false; bool isLogin = false;
bool isLoading = true; bool isLoading = true;
dynamic authenticatedUser; dynamic authenticatedUser;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AuthProvider() { AuthProvider() {
getUserAuthentication(); getUserAuthentication();
@ -355,4 +362,36 @@ class AuthProvider with ChangeNotifier {
throw error; throw error;
} }
} }
Future<Map> sendPatientIDSMS(mobileNo, context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"PatientID": 0,
"TokenID": "",
"PatientMobileNumber": mobileNo,
"SearchType": 2,
"ZipCode": "966",
"PatientIdentificationID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null
};
dynamic localRes;
await new BaseAppClient().post(FORGOT_PATIENT_ID,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
} }

@ -1,5 +1,6 @@
import 'package:badges/badges.dart'; import 'package:badges/badges.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -13,6 +14,8 @@ class BottomNavigationItem extends StatelessWidget {
final int currentIndex; final int currentIndex;
final String name; final String name;
var authProvider = new AuthProvider();
BottomNavigationItem( BottomNavigationItem(
{this.icon, {this.icon,
this.activeIcon, this.activeIcon,
@ -61,27 +64,58 @@ class BottomNavigationItem extends StatelessWidget {
), ),
], ],
) )
: Stack( : authProvider.isLogin
alignment: AlignmentDirectional.center, ? Stack(
children: [ alignment: AlignmentDirectional.center,
Positioned( children: [
right: 18.0, Positioned(
bottom: 28.0, right: 18.0,
child: Badge( bottom: 28.0,
toAnimate: false, child: Badge(
position: BadgePosition.topEnd(), toAnimate: false,
shape: BadgeShape.circle, position: BadgePosition.topEnd(),
badgeColor: Color(0xFF40ACC9).withOpacity(1.0), shape: BadgeShape.circle,
borderRadius: BorderRadius.circular(8), badgeColor: Color(0xFF40ACC9).withOpacity(1.0),
badgeContent: Container( borderRadius: BorderRadius.circular(8),
padding: EdgeInsets.all(2.0), badgeContent: Container(
child: Text(model.count.toString(), padding: EdgeInsets.all(2.0),
style: TextStyle( child: Text(model.count.toString(),
color: Colors.white, fontSize: 14.0)), style: TextStyle(
color: Colors.white, fontSize: 14.0)),
),
),
), ),
), Column(
), mainAxisSize: MainAxisSize.min,
Column( mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 15,
),
Container(
child: Icon(
currentIndex == index ? activeIcon : icon,
color: currentIndex == index
? Theme.of(context).primaryColor
: Theme.of(context).dividerColor,
size: 22.0),
),
SizedBox(
height: 5,
),
Texts(
name,
textAlign: TextAlign.center,
color: currentIndex == index
? Theme.of(context).primaryColor
: Theme.of(context).dividerColor,
fontSize: 11,
),
],
),
],
)
: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
@ -109,8 +143,6 @@ class BottomNavigationItem extends StatelessWidget {
), ),
], ],
), ),
],
),
), ),
), ),
), ),

Loading…
Cancel
Save