|
|
|
|
@ -3,6 +3,8 @@ import 'package:diplomaticquarterapp/core/viewModels/TermsConditionsViewModel.da
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_info_response_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_request_info_response_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
|
|
|
|
|
@ -13,6 +15,7 @@ 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/utils_new.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/Loader/gif_loader_container.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
@ -51,6 +54,7 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
|
|
|
|
|
NavigationDelegate(
|
|
|
|
|
onProgress: (int progress) {
|
|
|
|
|
// Update loading bar.
|
|
|
|
|
print("Progress: $progress");
|
|
|
|
|
},
|
|
|
|
|
onPageStarted: (String url) {},
|
|
|
|
|
onPageFinished: (String url) {
|
|
|
|
|
@ -82,7 +86,15 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
isShowDecPage: false,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).userAgreement,
|
|
|
|
|
body: WebViewWidget(controller: _controller),
|
|
|
|
|
body: isPageLoaded
|
|
|
|
|
? WebViewWidget(controller: _controller)
|
|
|
|
|
: Container(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: GifLoaderContainer(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding: const EdgeInsets.all(8.0),
|
|
|
|
|
// child: SingleChildScrollView(child: WebViewWidget(controller: _controller)
|
|
|
|
|
@ -193,6 +205,39 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
checkIfIsInPatient() {
|
|
|
|
|
bool isAdmitted = false;
|
|
|
|
|
bool hasAdmissionRequest = false;
|
|
|
|
|
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel;
|
|
|
|
|
GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel;
|
|
|
|
|
ClinicListService service = new ClinicListService();
|
|
|
|
|
service.checkIfInPatientAPI(context).then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
isAdmitted = res['isAdmitted'];
|
|
|
|
|
hasAdmissionRequest = res['hasAdmissionRequests'];
|
|
|
|
|
print("IS ADMITTED: $isAdmitted");
|
|
|
|
|
print("Has Admission Request: $hasAdmissionRequest");
|
|
|
|
|
if (isAdmitted) {
|
|
|
|
|
if (res['PatientAdmittedInformation'].length != 0) {
|
|
|
|
|
getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel.fromJson(res['PatientAdmittedInformation'][0]);
|
|
|
|
|
projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']);
|
|
|
|
|
projectViewModel.setInPatientAdmissionInfo(getAdmissionInfoResponseModel);
|
|
|
|
|
projectViewModel.setIsPatientAdmitted(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (hasAdmissionRequest) {
|
|
|
|
|
if (res['MedicalInstruction'].length != 0) {
|
|
|
|
|
getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel.fromJson(res['MedicalInstruction'][0]);
|
|
|
|
|
// projectViewModel.setInPatientProjectID(res['MedicalInstruction'][0]['ProjectID']);
|
|
|
|
|
projectViewModel.setInPatientProjectID(res['MedicalInstruction'][0]['projectId']);
|
|
|
|
|
projectViewModel.setInPatientAdmissionRequest(getAdmissionRequestInfoResponseModel);
|
|
|
|
|
projectViewModel.setPatientHasAdmissionRequest(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
goToHome() async {
|
|
|
|
|
widget.authenticatedUserObject.isLogin = true;
|
|
|
|
|
widget.appointmentRateViewModel.isLogin = true;
|
|
|
|
|
@ -202,6 +247,7 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
|
|
|
|
|
|
|
|
|
|
// GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
getToDoCount();
|
|
|
|
|
checkIfIsInPatient();
|
|
|
|
|
widget.appointmentRateViewModel
|
|
|
|
|
.getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2)
|
|
|
|
|
.then((value) => {
|
|
|
|
|
|