diff --git a/assets/images/medical/blood_cholesterol_icon.png b/assets/images/medical/blood_cholesterol_icon.png new file mode 100644 index 00000000..3f1ab216 Binary files /dev/null and b/assets/images/medical/blood_cholesterol_icon.png differ diff --git a/assets/images/medical/blood_sugar_icon.png b/assets/images/medical/blood_sugar_icon.png new file mode 100644 index 00000000..6c9e8133 Binary files /dev/null and b/assets/images/medical/blood_sugar_icon.png differ diff --git a/assets/images/medical/triglycerides_blood_icon.png b/assets/images/medical/triglycerides_blood_icon.png new file mode 100644 index 00000000..b3bebf9e Binary files /dev/null and b/assets/images/medical/triglycerides_blood_icon.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 47bb9809..90c37129 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -7,7 +7,7 @@ const MAX_SMALL_SCREEN = 660; const BASE_URL = 'https://hmgwebservices.com/'; -const GET_PROJECT = '/Lists.svc/REST/GetProject'; +const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; ///Doctor const GET_MY_DOCTOR = @@ -54,8 +54,19 @@ const GET_PATIENT_VITAL_SIGN = const GET_NEAREST_HOSPITAL= 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; +///Er Nearest +const GET_AMBULANCE_REQUEST= + 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; + + +///FindUs +const GET_FINDUS_REQUEST= + 'Services/Lists.svc/REST/Get_HMG_Locations'; +///LiveChat +const GET_LIVECHAT_REQUEST= + 'Services/Patients.svc/REST/GetPatientICProjects'; ///Reports @@ -193,6 +204,14 @@ const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; +const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; +const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; +const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; +const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; +const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; + +const TIMER_MIN = 10; + class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 9e399464..edf5c751 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -503,4 +503,45 @@ const Map> localizedValues = { "en": "MyVaccinesAvailability", "ar": "توفر لقاحي" }, + "PaymentService": {"en": "Payment Service", "ar": "خدمة المدفوعات"}, + "PaymentOnline": {"en": "Service", "ar": "الالكتروني"}, + "OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"}, + "MyBalances": {"en": "My Balances", "ar": "رصيدي"}, + "BalanceAmount": {"en": "Balance Amount", "ar": "رصيدالحساب"}, + "TotalBalance": {"en": "Total Balance", "ar": "الرصيد الكلي"}, + "CreateAdvancedPayment": { + "en": "Create Advanced Payment", + "ar": "إنشاء دفعة مقدمة" + }, + "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, + "AdvancePaymentLabel": { + "en": + "You can create and add an Advanced Payment for you account or other accounts.", + "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين" + }, + "FileNumber": {"en": "File Number", "ar": "رقم الملف"}, + "Amount": {"en": "Amount *", "ar": "المبلغ *"}, + "DepositorEmail": { + "en": "Depositor Email *", + "ar": "البريد الإلكتروني للمودع *" + }, + "Notes": {"en": "Notes", "ar": "ملاحظات"}, + "SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"}, + "SelectFamilyPatientName": {"en": "Family Members", "ar": "أفراد الأسرة"}, + "SelectHospital": {"en": "Select Hospital", "ar": "اختر المستشفى"}, + "MyAccount": {"en": "My Account", "ar": "حسابي"}, + "OtherAccount": {"en": "Other Account", "ar": "حساب آخر"}, + "SelectBeneficiary": {"en": "Select Beneficiary", "ar": "حدد المستفيد"}, + "ConfirmThePayment": {"en": "Confirm The Payment", "ar": "تأكيد عملية الدفع"}, + "DepositorName": {"en": "Depositor Name", "ar": "اسم المودع *"}, + "MobileNumber": {"en": "Mobile Number", "ar": "رقم الجوال"}, + "Ok": {"en": "Ok", "ar": "حسنا"}, + "TheVerificationCodeExpiresIn": { + "en": "The Verification Code Expires In", + "ar": "تنتهي صلاحية رمز التحقق في" + }, + "PleaseEnterTheVerificationCode": { + "en": "Please enter the verification code send to", + "ar": "الرجاء إدخال رمز التحقق المرسل إلى" + }, }; diff --git a/lib/core/model/contactus/get_hmg_locations.dart b/lib/core/model/contactus/get_hmg_locations.dart new file mode 100644 index 00000000..89d26951 --- /dev/null +++ b/lib/core/model/contactus/get_hmg_locations.dart @@ -0,0 +1,80 @@ +class GetHMGLocationsModel { + dynamic cityID; + String cityName; + dynamic cityNameN; + dynamic distanceInKilometers; + bool isActive; + String latitude; + int locationID; + String locationName; + dynamic locationNameN; + dynamic locationType; + String longitude; + int pharmacyLocationID; + String phoneNumber; + int projectID; + String projectImageURL; + int setupID; + dynamic sortOrder; + + GetHMGLocationsModel( + {this.cityID, + this.cityName, + this.cityNameN, + this.distanceInKilometers, + this.isActive, + this.latitude, + this.locationID, + this.locationName, + this.locationNameN, + this.locationType, + this.longitude, + this.pharmacyLocationID, + this.phoneNumber, + this.projectID, + this.projectImageURL, + this.setupID, + this.sortOrder}); + + GetHMGLocationsModel.fromJson(Map json) { + cityID = json['CityID']; + cityName = json['CityName']; + cityNameN = json['CityNameN']; + distanceInKilometers = json['DistanceInKilometers']; + isActive = json['IsActive']; + latitude = json['Latitude']; + locationID = json['LocationID']; + locationName = json['LocationName']; + locationNameN = json['LocationNameN']; + locationType = json['LocationType']; + longitude = json['Longitude']; + pharmacyLocationID = json['PharmacyLocationID']; + phoneNumber = json['PhoneNumber']; + projectID = json['ProjectID']; + projectImageURL = json['ProjectImageURL']; + setupID = json['SetupID']; + sortOrder = json['SortOrder']; + } + + Map toJson() { + final Map data = new Map(); + data['CityID'] = this.cityID; + data['CityName'] = this.cityName; + data['CityNameN'] = this.cityNameN; + data['DistanceInKilometers'] = this.distanceInKilometers; + data['IsActive'] = this.isActive; + data['Latitude'] = this.latitude; + data['LocationID'] = this.locationID; + data['LocationName'] = this.locationName; + data['LocationNameN'] = this.locationNameN; + data['LocationType'] = this.locationType; + data['Longitude'] = this.longitude; + data['PharmacyLocationID'] = this.pharmacyLocationID; + data['PhoneNumber'] = this.phoneNumber; + data['ProjectID'] = this.projectID; + data['ProjectImageURL'] = this.projectImageURL; + data['SetupID'] = this.setupID; + data['SortOrder'] = this.sortOrder; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/contactus/get_patientI_cprojects.dart b/lib/core/model/contactus/get_patientI_cprojects.dart new file mode 100644 index 00000000..e9a6b712 --- /dev/null +++ b/lib/core/model/contactus/get_patientI_cprojects.dart @@ -0,0 +1,54 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class GetPatientICProjectsModel { + int id; + String projectName; + String projectNameN; + String value; + dynamic languageId; + DateTime createdOn; + String createdBy; + dynamic editedOn; + dynamic editedBy; + bool isActive; + + GetPatientICProjectsModel( + {this.id, + this.projectName, + this.projectNameN, + this.value, + this.languageId, + this.createdOn, + this.createdBy, + this.editedOn, + this.editedBy, + this.isActive}); + + GetPatientICProjectsModel.fromJson(Map json) { + id = json['id']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + value = json['Value']; + languageId = json['LanguageId']; + createdOn = DateUtil.convertStringToDate(json['CreatedOn']); + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + isActive = json['IsActive']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + data['Value'] = this.value; + data['LanguageId'] = this.languageId; + data['CreatedOn'] = this.createdOn; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['IsActive'] = this.isActive; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/er/get_all_transportation_method_list_model.dart b/lib/core/model/er/get_all_transportation_method_list_model.dart new file mode 100644 index 00000000..3402873e --- /dev/null +++ b/lib/core/model/er/get_all_transportation_method_list_model.dart @@ -0,0 +1,79 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +class PatientER_RRT_GetAllTransportationMethodListModel { + int id; + DateTime createDate; + DateTime lastEditDate; + int createdBy; + int lastEditBy; + bool isActive; + String title; + String titleAR; + int price; + Null isDefault; + int visibility; + Null durationId; + String description; + String descriptionAR; + int totalPrice; + int vAT; + + PatientER_RRT_GetAllTransportationMethodListModel( + { + this.id, + this.createDate, + this.lastEditDate, + this.createdBy, + this.lastEditBy, + this.isActive, + this.title, + this.titleAR, + this.price, + this.isDefault, + this.visibility, + this.durationId, + this.description, + this.descriptionAR, + this.totalPrice, + this.vAT}); + + PatientER_RRT_GetAllTransportationMethodListModel.fromJson( + Map json) { + id = json['Id']; + createDate = DateUtil.convertStringToDate(json['CreateDate']); + lastEditDate = DateUtil.convertStringToDate(json['LastEditDate']); + createdBy = json['CreatedBy']; + lastEditBy = json['LastEditBy']; + isActive = json['IsActive']; + title = json['Title']; + titleAR = json['TitleAR']; + price = json['Price']; + isDefault = json['isDefault']; + visibility = json['Visibility']; + durationId = json['DurationId']; + description = json['Description']; + descriptionAR = json['DescriptionAR']; + totalPrice = json['TotalPrice']; + vAT = json['VAT']; + } + + Map toJson() { + final Map data = new Map(); + data['Id'] = this.id; + data['CreateDate'] = this.createDate; + data['LastEditDate'] = this.lastEditDate; + data['CreatedBy'] = this.createdBy; + data['LastEditBy'] = this.lastEditBy; + data['IsActive'] = this.isActive; + data['Title'] = this.title; + data['TitleAR'] = this.titleAR; + data['Price'] = this.price; + data['isDefault'] = this.isDefault; + data['Visibility'] = this.visibility; + data['DurationId'] = this.durationId; + data['Description'] = this.description; + data['DescriptionAR'] = this.descriptionAR; + data['TotalPrice'] = this.totalPrice; + data['VAT'] = this.vAT; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/hospitals/hospitals_model.dart b/lib/core/model/hospitals/hospitals_model.dart index a8308de8..264528c7 100644 --- a/lib/core/model/hospitals/hospitals_model.dart +++ b/lib/core/model/hospitals/hospitals_model.dart @@ -1,18 +1,18 @@ class HospitalsModel { String desciption; Null desciptionN; - int iD; + dynamic iD; String legalName; String legalNameN; String name; Null nameN; String phoneNumber; String setupID; - int distanceInKilometers; + dynamic distanceInKilometers; bool isActive; String latitude; String longitude; - int mainProjectID; + dynamic mainProjectID; Null projectOutSA; bool usingInDoctorApp; diff --git a/lib/core/model/my_balance/AdvanceModel.dart b/lib/core/model/my_balance/AdvanceModel.dart new file mode 100644 index 00000000..40472b13 --- /dev/null +++ b/lib/core/model/my_balance/AdvanceModel.dart @@ -0,0 +1,18 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; + +class AdvanceModel { + String fileNumber; + String amount; + HospitalsModel hospitalsModel; + String email; + String note; + String depositorName; + + AdvanceModel( + {this.amount, + this.email, + this.note, + this.hospitalsModel, + this.fileNumber, + this.depositorName}); +} diff --git a/lib/core/model/my_balance/patient_advance_balance_amount.dart b/lib/core/model/my_balance/patient_advance_balance_amount.dart new file mode 100644 index 00000000..44a5083f --- /dev/null +++ b/lib/core/model/my_balance/patient_advance_balance_amount.dart @@ -0,0 +1,28 @@ +class PatientAdvanceBalanceAmount { + int distanceInKilometers; + dynamic patientAdvanceBalanceAmount; + String projectDescription; + int projectID; + + PatientAdvanceBalanceAmount( + {this.distanceInKilometers, + this.patientAdvanceBalanceAmount, + this.projectDescription, + this.projectID}); + + PatientAdvanceBalanceAmount.fromJson(Map json) { + distanceInKilometers = json['DistanceInKilometers']; + patientAdvanceBalanceAmount = json['PatientAdvanceBalanceAmount']; + projectDescription = json['ProjectDescription']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['DistanceInKilometers'] = this.distanceInKilometers; + data['PatientAdvanceBalanceAmount'] = this.patientAdvanceBalanceAmount; + data['ProjectDescription'] = this.projectDescription; + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/model/my_balance/patient_info.dart b/lib/core/model/my_balance/patient_info.dart new file mode 100644 index 00000000..6004f014 --- /dev/null +++ b/lib/core/model/my_balance/patient_info.dart @@ -0,0 +1,32 @@ +class PatientInfo { + String fullName; + String mobileNumber; + int patientID; + int projectID; + String zipCode; + + PatientInfo( + {this.fullName, + this.mobileNumber, + this.patientID, + this.projectID, + this.zipCode}); + + PatientInfo.fromJson(Map json) { + fullName = json['FullName']; + mobileNumber = json['MobileNumber']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + zipCode = json['ZipCode']; + } + + Map toJson() { + final Map data = new Map(); + data['FullName'] = this.fullName; + data['MobileNumber'] = this.mobileNumber; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ZipCode'] = this.zipCode; + return data; + } +} diff --git a/lib/core/model/my_balance/patient_info_and_mobile_number.dart b/lib/core/model/my_balance/patient_info_and_mobile_number.dart new file mode 100644 index 00000000..8f05b4d9 --- /dev/null +++ b/lib/core/model/my_balance/patient_info_and_mobile_number.dart @@ -0,0 +1,84 @@ +class PatientInfoAndMobileNumber { + String setupID; + int projectID; + int mainAccountID; + int patientType; + int patientID; + String firstName; + Null middleName; + Null lastName; + Null firstNameN; + Null middleNameN; + Null lastNameN; + Null gender; + Null dateofBirth; + Null dateofBirthN; + Null nationalityID; + String mobileNumber; + String emailAddress; + Null zipCode; + + PatientInfoAndMobileNumber( + {this.setupID, + this.projectID, + this.mainAccountID, + this.patientType, + this.patientID, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.dateofBirthN, + this.nationalityID, + this.mobileNumber, + this.emailAddress, + this.zipCode}); + + PatientInfoAndMobileNumber.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + mainAccountID = json['MainAccountID']; + patientType = json['PatientType']; + patientID = json['PatientID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + dateofBirthN = json['DateofBirthN']; + nationalityID = json['NationalityID']; + mobileNumber = json['MobileNumber']; + emailAddress = json['EmailAddress']; + zipCode = json['ZipCode']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['MainAccountID'] = this.mainAccountID; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['DateofBirthN'] = this.dateofBirthN; + data['NationalityID'] = this.nationalityID; + data['MobileNumber'] = this.mobileNumber; + data['EmailAddress'] = this.emailAddress; + data['ZipCode'] = this.zipCode; + return data; + } +} diff --git a/lib/core/model/sick_leave/sick_leave.dart b/lib/core/model/sick_leave/sick_leave.dart index d5e6e76c..ff73e1da 100644 --- a/lib/core/model/sick_leave/sick_leave.dart +++ b/lib/core/model/sick_leave/sick_leave.dart @@ -97,6 +97,7 @@ class SickLeave { patientName = json['PatientName']; projectName = json['ProjectName']; qR = json['QR']; + if(json['Speciality']!=null) speciality = json['Speciality'].cast(); } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8fde2166..4d04378a 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -55,22 +55,24 @@ class BaseAppClient { body['DeviceTypeID'] = DeviceTypeID; - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE - : PATIENT_TYPE; + if(!body.containsKey('IsPublicRequest')) { + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE + : PATIENT_TYPE; - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; - if (user != null) { - body['TokenID'] = token; - body['PatientID'] = - body['PatientID'] != null ? body['PatientID'] : user['PatientID']; - body['PatientOutSA'] = user['OutSA']; - body['SessionID'] = getSessionId(token); + if (user != null) { + body['TokenID'] = token; + body['PatientID'] = + body['PatientID'] != null ? body['PatientID'] : user['PatientID']; + body['PatientOutSA'] = user['OutSA']; + body['SessionID'] = getSessionId(token); + } } print("URL : $url"); diff --git a/lib/core/service/contactus/finadus_service.dart b/lib/core/service/contactus/finadus_service.dart new file mode 100644 index 00000000..4086def9 --- /dev/null +++ b/lib/core/service/contactus/finadus_service.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; +import '../base_service.dart'; + +class FindusService extends BaseService { + + + List FindusModelList = List(); + List FindusHospitalModelList = List(); + List FindusPharmaciesModelList = List(); + Map body = Map(); + + Future getAllFindUsOrders() async { + hasError = false; + + await baseAppClient.post(GET_FINDUS_REQUEST, + onSuccess: (dynamic response, int statusCode) { + FindusModelList.clear(); + FindusHospitalModelList.clear(); + FindusPharmaciesModelList.clear(); + + response['ListHMGLocation'].forEach((vital) { + if (GetHMGLocationsModel.fromJson(vital).locationType == 1) { + FindusHospitalModelList.add(GetHMGLocationsModel.fromJson(vital)); + } else { + FindusPharmaciesModelList.add(GetHMGLocationsModel.fromJson(vital)); + } + + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/contactus/livechat_service.dart b/lib/core/service/contactus/livechat_service.dart new file mode 100644 index 00000000..ae8fabc9 --- /dev/null +++ b/lib/core/service/contactus/livechat_service.dart @@ -0,0 +1,39 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_patientI_cprojects.dart'; +import '../base_service.dart'; + +class LiveChatService extends BaseService{ + + + + + List LivechatModelList=List(); + + + Map body = Map(); + + + + Future getAllLiveChatOrders() async { + hasError = false; + body['List_PatientICProjects'] =false; + await baseAppClient.post(GET_LIVECHAT_REQUEST, + onSuccess: (dynamic response, int statusCode) { + LivechatModelList.clear(); + + + response['List_PatientICProjects'].forEach((vital) { + + LivechatModelList.add(GetPatientICProjectsModel.fromJson(vital)); + + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + +} \ No newline at end of file diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart new file mode 100644 index 00000000..181ad37b --- /dev/null +++ b/lib/core/service/er/am_service.dart @@ -0,0 +1,25 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import '../base_service.dart'; + +class AmService extends BaseService { + List AmModelList = List(); + Map body = Map(); + + Future getAllTransportationOrders() async { + hasError = false; + + await baseAppClient.post(GET_AMBULANCE_REQUEST, + onSuccess: (dynamic response, int statusCode) { + AmModelList.clear(); + response['AmModelList'].forEach((vital) { + AmModelList.add( + PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/hospital_service.dart b/lib/core/service/hospital_service.dart index c131d94f..194b8256 100644 --- a/lib/core/service/hospital_service.dart +++ b/lib/core/service/hospital_service.dart @@ -2,35 +2,43 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/request_get_hospitals_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:geolocator/geolocator.dart'; class HospitalService extends BaseService { List _hospitals = List(); List get hospitals => _hospitals; - RequestGetHospitalsModel _requestGetHospitalsModel = RequestGetHospitalsModel( - latitude: 0, - longitude: 0, - versionID: 5.2, - channel: 3, - languageID: 2, - iPAdress: '10.20.10.20', - generalid: 'Cs2020@2016\$2958', - patientOutSA: 0, - sessionID: 'JUWuiMBCEGkAAxQpakQ', - isDentalAllowedBackend: false, - deviceTypeID: 2); + double _latitude; + double _longitude; + + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + // currentLocation = LatLng(position.latitude, position.longitude); + } Future getHospitals() async { + await _getCurrentLocation(); + Map body = Map(); + body['Latitude'] = _latitude; + body['Longitude'] = _longitude; + await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) { - _hospitals.clear(); + _hospitals.clear(); response['ListProject'].forEach((hospital) { _hospitals.add(HospitalsModel.fromJson(hospital)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestGetHospitalsModel.toJson()); + }, body: body); } + } diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart new file mode 100644 index 00000000..27d5d602 --- /dev/null +++ b/lib/core/service/medical/my_balance_service.dart @@ -0,0 +1,149 @@ +import 'dart:convert'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class MyBalanceService extends BaseService { + List patientAdvanceBalanceAmountList = List(); + double totalAdvanceBalanceAmount; + List patientInfoList = List(); + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse(); + PatientInfoAndMobileNumber patientInfoAndMobileNumber; + String logInTokenID; + String verificationCode; + + getPatientAdvanceBalanceAmount() async { + hasError = false; + super.error = ""; + await baseAppClient.post(GET_PATIENT_AdVANCE_BALANCE_AMOUNT, + onSuccess: (response, statusCode) async { + patientAdvanceBalanceAmountList.clear(); + response['List_PatientAdvanceBalanceAmount'].forEach((item) { + patientAdvanceBalanceAmountList + .add(PatientAdvanceBalanceAmount.fromJson(item)); + }); + totalAdvanceBalanceAmount = response['TotalAdvanceBalanceAmount']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + getPatientInfoByPatientID({String id}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['SearchPatientID'] = int.parse(id); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_PATIENT_INFO_BY_ID, + onSuccess: (response, statusCode) async { + patientInfoList.clear(); + response['GetPatientInfoByPatientIDList'].forEach((item) { + patientInfoList.add(PatientInfo.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + getPatientInfoByPatientIDAndMobileNumber() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['MobileNo'] = user.mobileNumber; + body['ProjectID'] = user.projectID; + + await baseAppClient.post(GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER, + onSuccess: (response, statusCode) async { + response['List_PatientInfo'].forEach((item) { + patientInfoAndMobileNumber = PatientInfoAndMobileNumber.fromJson(item); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + super.error = error; + }, body: body); + } + + sendActivationCodeForAdvancePayment({int patientID,int projectID}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['PatientID'] = patientID; + body['ProjectID'] = projectID; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT, + onSuccess: (response, statusCode) async { + logInTokenID = response['LogInTokenID']; + verificationCode = response['VerificationCode']; + print(verificationCode); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + super.error = error; + }, body: body); + } + + checkActivationCodeForAdvancePayment({String activationCode}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['activationCode'] = activationCode; + body['PatientMobileNumber'] = 'XXXXXXXXXX'; + body['isDentalAllowedBackend'] = false; + body['LogInTokenID'] = logInTokenID; + + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT, + onSuccess: (response, statusCode) async { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + super.error = error; + }, body: body); + } + + getSharedRecordByStatus() async { + try { + var request = GetAllSharedRecordsByStatusReq(); + request.status = 0; + await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, + onSuccess: (dynamic response, int statusCode) { + sharedPref.setObject(FAMILY_FILE, response); + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(response); + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + hasError = true; + super.error = error; + }, body: request.toJson()); + } catch (error) { + print(error); + hasError = true; + super.error = error; + } + } + + getFamilyFiles() async { + if (await sharedPref.getObject(FAMILY_FILE) != null) { + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson( + await sharedPref.getObject(FAMILY_FILE)); + return getAllSharedRecordsByStatusResponse; + } else { + return getSharedRecordByStatus(); + } + } +} diff --git a/lib/core/viewModels/contactus/findus_view_model.dart b/lib/core/viewModels/contactus/findus_view_model.dart new file mode 100644 index 00000000..800c3106 --- /dev/null +++ b/lib/core/viewModels/contactus/findus_view_model.dart @@ -0,0 +1,30 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; +import 'package:diplomaticquarterapp/core/service/contactus/finadus_service.dart'; +import '../base_view_model.dart'; +import '../../../locator.dart'; + +class FindusViewModel extends BaseViewModel { + FindusService _findusService = locator(); + + List get FindusModelList => + _findusService.FindusModelList; + + List get FindusHospitalModelList=> + _findusService.FindusHospitalModelList; + + List get FindusPharmaciesModelList=> + _findusService.FindusPharmaciesModelList; + + getFindUsRequestOrders() async { + setState(ViewState.Busy); + + await _findusService.getAllFindUsOrders(); + + if (_findusService.hasError) { + error = _findusService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModels/contactus/livechat_view_model.dart b/lib/core/viewModels/contactus/livechat_view_model.dart new file mode 100644 index 00000000..8df4e801 --- /dev/null +++ b/lib/core/viewModels/contactus/livechat_view_model.dart @@ -0,0 +1,33 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_patientI_cprojects.dart'; +import 'package:diplomaticquarterapp/core/service/contactus/livechat_service.dart'; +import '../base_view_model.dart'; +import '../../../locator.dart'; + + +class LiveChatViewModel extends BaseViewModel{ + + + + LiveChatService _liveChatService =locator(); + + List get LiveChatModelList=> + + _liveChatService.LivechatModelList; + + + getLiveChatRequestOrders() async { + setState(ViewState.Busy); + + await _liveChatService.getAllLiveChatOrders(); + + if (_liveChatService.hasError) { + error = _liveChatService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + + +} \ No newline at end of file diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart new file mode 100644 index 00000000..db1acbf0 --- /dev/null +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -0,0 +1,32 @@ + +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import '../base_view_model.dart'; +import '../../../locator.dart'; + +class AmRequestViewModel extends BaseViewModel{ + + + AmService _amService = locator(); + + List get AmRequestModeList=> + _amService.AmModelList; + + getAmRequestOrders({int id, int projectID}) async { + setState(ViewState.Busy); + + + await _amService.getAllTransportationOrders(); + + if ( _amService.hasError) { + error = _amService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + + +} \ No newline at end of file diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart new file mode 100644 index 00000000..350e9d89 --- /dev/null +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -0,0 +1,116 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; +import 'package:diplomaticquarterapp/core/service/medical/my_balance_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class MyBalanceViewModel extends BaseViewModel { + MyBalanceService _myBalanceService = locator(); + + HospitalService _hospitalService = locator(); + + List get hospitals => _hospitalService.hospitals; + + List get patientAdvanceBalanceAmountList => + _myBalanceService.patientAdvanceBalanceAmountList; + + double get totalAdvanceBalanceAmount => + _myBalanceService.totalAdvanceBalanceAmount; + + GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse => + _myBalanceService.getAllSharedRecordsByStatusResponse; + + List get patientInfoList => _myBalanceService.patientInfoList; + + PatientInfoAndMobileNumber get patientInfoAndMobileNumber => + _myBalanceService.patientInfoAndMobileNumber; + + + String get logInTokenID => _myBalanceService.logInTokenID; + String get verificationCode => _myBalanceService.verificationCode; + + getPatientAdvanceBalanceAmount() async { + setState(ViewState.Busy); + await _myBalanceService.getPatientAdvanceBalanceAmount(); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getHospitals() async { + setState(ViewState.Busy); + await _hospitalService.getHospitals(); + if (_hospitalService.hasError) { + error = _hospitalService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getPatientInfoByPatientID({String id}) async { + setState(ViewState.Busy); + await _myBalanceService.getPatientInfoByPatientID(id: id); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } + + Future getPatientInfoByPatientIDAndMobileNumber() async { + setState(ViewState.Busy); + await _myBalanceService.getPatientInfoByPatientIDAndMobileNumber(); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } + + Future sendActivationCodeForAdvancePayment({int patientID,int projectID}) async { + setState(ViewState.Busy); + await _myBalanceService.sendActivationCodeForAdvancePayment(patientID: patientID,projectID: projectID); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } + Future checkActivationCodeForAdvancePayment({String activationCode}) async { + setState(ViewState.Busy); + await _myBalanceService.checkActivationCodeForAdvancePayment(activationCode: activationCode); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getFamilyFiles() async { + setState(ViewState.Busy); + await _myBalanceService.getFamilyFiles(); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 8f347f42..072370b7 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -4,25 +4,33 @@ import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; import 'core/service/appointment_rate_service.dart'; +import 'core/service/contactus/finadus_service.dart'; +import 'core/service/contactus/livechat_service.dart'; import 'core/service/dashboard_service.dart'; +import 'core/service/er/am_service.dart'; import 'core/service/er/er_service.dart'; import 'core/service/feedback/feedback_service.dart'; import 'core/service/hospital_service.dart'; import 'core/service/medical/PatientSickLeaveService.dart'; import 'core/service/medical/labs_service.dart'; import 'core/service/medical/medical_service.dart'; +import 'core/service/medical/my_balance_service.dart'; import 'core/service/medical/my_doctor_service.dart'; import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/radiology_service.dart'; import 'core/service/medical/reports_monthly_service.dart'; import 'core/service/medical/vital_sign_service.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; +import 'core/viewModels/contactus/findus_view_model.dart'; +import 'core/viewModels/contactus/livechat_view_model.dart'; +import 'core/viewModels/er/am_request_view_model.dart'; import 'core/viewModels/er/near_hospital_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/service/medical/reports_service.dart'; import 'core/viewModels/hospital_view_model.dart'; import 'core/viewModels/medical/labs_view_model.dart'; import 'core/viewModels/medical/medical_view_model.dart'; +import 'core/viewModels/medical/my_balance_view_model.dart'; import 'core/viewModels/medical/my_doctor_view_model.dart'; import 'core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'core/viewModels/medical/prescriptions_view_model.dart'; @@ -61,7 +69,13 @@ void setupLocator() { locator.registerFactory(() => VaccineService()); locator.registerLazySingleton(() => ReportsMonthlyService()); locator.registerLazySingleton(() => ErService()); + locator.registerLazySingleton(() => AmService()); + + locator.registerLazySingleton(() => PatientSickLeaveService()); + locator.registerLazySingleton(() => MyBalanceService()); + locator.registerLazySingleton(() => FindusService()); + locator.registerLazySingleton(() => LiveChatService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -81,6 +95,10 @@ void setupLocator() { locator.registerFactory(() => QrViewModel()); locator.registerFactory(() => ReportsMonthlyViewModel()); locator.registerFactory(() => NearHospitalViewModel()); + locator.registerFactory(() => AmRequestViewModel()); locator.registerFactory(() => PatientSickLeaveViewMode()); + locator.registerFactory(() => MyBalanceViewModel()); + locator.registerFactory(() => FindusViewModel()); + locator.registerFactory(() => LiveChatViewModel()); } diff --git a/lib/main.dart b/lib/main.dart index 0c6b2760..ec42e7a3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -68,7 +68,7 @@ class MyApp extends StatelessWidget { errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor:Hexcolor('#E9E9E9'),// Colors.grey[100], textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), - textSelectionHandleColor: Color.fromRGBO(80, 100, 253, 1.0), + textSelectionHandleColor: Colors.grey, canvasColor: Colors.white, backgroundColor: Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100].withOpacity(0.4), @@ -77,7 +77,7 @@ class MyApp extends StatelessWidget { bottomSheetTheme:BottomSheetThemeData( backgroundColor: Hexcolor('#E0E0E0') ) , - cursorColor: Color.fromRGBO(78, 62, 253, 1.0), + cursorColor: Colors.grey, iconTheme: IconThemeData(), appBarTheme: AppBarTheme( color: Colors.grey[700], diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index dc0d3cd2..616b5fd8 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,10 +1,21 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; +import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; +import 'package:diplomaticquarterapp/pages/family/my-family.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; + +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; +import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; +import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; class AllHabibMedicalService extends StatefulWidget { @override @@ -17,31 +28,273 @@ class _AllHabibMedicalServiceState extends State { return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).alhabiServices, - body: ListView( - children: [ - InkWell( - onTap: ()=> Navigator.push(context, FadePage(page: ParkingPage())), - child: Container( - height: 50, - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(7), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Texts( - TranslationBase.of(context).parking, - fontSize: 16, - ) - ], - ), - ), + body: Column( + children: [ + Expanded( + child: ListView( + scrollDirection: Axis.vertical, + physics: AlwaysScrollableScrollPhysics(), + shrinkWrap: true, + children: [ + Container( + width: double.infinity, + height: 190, + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage('assets/images/timeline_bg.png'), + fit: BoxFit.cover, + ), + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Health Weather Indicators', + style: TextStyle( + color: Colors.white, + fontSize: 22.0, + fontWeight: FontWeight.w600, + ), + ), + SizedBox( + height: 35.0, + ), + Text( + 'Health Tips Based On Current Weather', + style: TextStyle( + color: Colors.white, + ), + ), + ]), + ), + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: MedicalProfilePage(), + ), + ), + imageLocation: + 'assets/images/new-design/my_file_bottom_bar.png', + title: TranslationBase.of(context).myMedicalFile, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: LiveCareHome(), + ), + ), + imageLocation: 'assets/images/new-design/liveCare_ar_bg.png', + title: TranslationBase.of(context).livecare, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: BookingOptions( + isAppbar: true, + ), + ), + ), + imageLocation: + 'assets/images/new-design/booking_icon_active.png', + title: TranslationBase.of(context).bookAppo, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: PaymentService(), + ), + ), + imageLocation: + 'assets/images/al-habib_online_payment_service_icon.png', + title: TranslationBase.of(context).onlinePaymentService, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: + 'assets/images/al-habib_online_payment_service_icon.png', + title: 'Covid-19- Drive-Thru Test', + ), + ServicesContainer( + onTap: () { + Navigator.push( + context, + FadePage( + page: ErOptions( + isAppbar: true, + ), + ), + ); + }, + imageLocation: 'assets/images/emergency_service_image.png', + title: TranslationBase.of(context).emergencyService, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ParkingPage(), + ), + ), + imageLocation: 'assets/images/pharmacy_logo.png', + title: 'Pharmacy'), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: InsuranceUpdate(), + ), + ), + imageLocation: + 'assets/images/medical/insurance_card_icon.png', + title: TranslationBase.of(context).updateInsurance, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: 'assets/images/ereferral_service_icon.png', + title: 'E-Referral', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: MyFamily(), + ), + ), + imageLocation: + 'assets/images/new-design/family_menu_icon_red.png', + title: 'My Family', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: + 'assets/images/new-design/children_vaccines_icon.png', + title: 'Child Vaccines', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ToDo(), + ), + ), + imageLocation: + 'assets/images/new-design/upcoming_icon_bottom_bar.png', + title: TranslationBase.of(context).todoList, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: 'assets/images/new-design/body_icon.png', + title: 'Symptom Checker'), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: 'assets/images/new-design/blood_icon.png', + title: 'Blood Donation', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: + 'assets/images/new-design/health_calculator_icon.png', + title: 'Health Calculators', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + //page: HealthConverter(), + ), + ), + imageLocation: + 'assets/images/new-design/health_convertor_icon.png', + title: 'Health Converter', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ParkingPage(), + ), + ), + imageLocation: 'assets/images/new-design/water_icon.png', + title: 'H2O', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: 'assets/images/new-design/smartwatch_icon.png', + title: TranslationBase.of(context).smartWatches, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ParkingPage(), + ), + ), + imageLocation: + 'assets/images/new-design/parking_system_icon.png', + title: TranslationBase.of(context).parking, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ParkingPage(), + ), + ), + imageLocation: + 'assets/images/new-design/virtual_tour_icon.png', + title: 'Virtual Tour', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ParkingPage(), + ), + ), + imageLocation: + 'assets/images/new-design/twitter_dashboard_icon.png', + title: 'Latest News', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ParkingPage(), + ), + ), + imageLocation: 'assets/images/new-design/find_us_icon.png', + title: 'Find Us', + ), + ], ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_converter.dart b/lib/pages/AlHabibMedicalService/health_converter.dart new file mode 100644 index 00000000..b499724c --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_converter.dart @@ -0,0 +1,94 @@ +// import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +// import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +// import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +// import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +// import 'package:flutter/material.dart'; +// +// import 'health_converter/blood_sugar.dart'; +// +// class HealthConverter extends StatefulWidget { +// @override +// _HealthConverterState createState() => _HealthConverterState(); +// } +// +// class _HealthConverterState extends State { +// @override +// Widget build(BuildContext context) { +// return AppScaffold( +// isShowAppBar: true, +// appBarTitle: 'Health Converter', +// body: Column( +// children: [ +// Container( +// width: double.infinity, +// height: 30, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// Navigator.push( +// context, +// FadePage(page: BloodSugar()), +// ); +// }, +// child: MedicalProfileItem( +// title: 'Blood', +// imagePath: 'blood_sugar_icon.png', +// subTitle: 'Sugar', +// ), +// ), +// ), +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// Navigator.push( +// context, +// FadePage( +// // page: [](), +// ), +// ); +// }, +// child: MedicalProfileItem( +// title: 'Blood', +// imagePath: 'blood_cholesterol_icon.png', +// subTitle: 'Cholesterol', +// ), +// ), +// ), +// ], +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// Navigator.push( +// context, +// FadePage( +// // page: [](), +// ), +// ); +// }, +// child: MedicalProfileItem( +// title: 'Triglycerides', +// imagePath: 'triglycerides_blood_icon.png', +// subTitle: 'Fat in blood', +// ), +// ), +// ), +// Expanded( +// flex: 1, +// child: Container(), +// ), +// ], +// ) +// ], +// ), +// ); +// } +// } diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart new file mode 100644 index 00000000..654df11f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart @@ -0,0 +1,208 @@ +// import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +// import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +// import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +// import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter/services.dart'; +// +// const activeCardColor = Color(0xff70777A); +// const inactiveCardColor = Color(0xffFAFAFd); +// +// class BloodSugar extends StatefulWidget { +// @override +// _BloodSugarState createState() => _BloodSugarState(); +// } +// +// Color color; +// +// class _BloodSugarState extends State { +// Color cardMGColor = inactiveCardColor; +// Color cardMMOLColor = inactiveCardColor; +// +// void updateColor(int type) { +// //MG/DLT card +// if (type == 1) { +// if (cardMGColor == inactiveCardColor) { +// cardMGColor = activeCardColor; +// cardMMOLColor = inactiveCardColor; +// } else { +// cardMGColor = inactiveCardColor; +// } +// } +// if (type == 2) { +// if (cardMMOLColor == inactiveCardColor) { +// cardMMOLColor = activeCardColor; +// cardMGColor = inactiveCardColor; +// } else { +// cardMMOLColor = inactiveCardColor; +// } +// } +// } +// +// bool _visible = false; +// +// TextEditingController textController = new TextEditingController(); +// String finalValue; +// +// @override +// Widget build(BuildContext context) { +// return AppScaffold( +// isShowAppBar: true, +// appBarTitle: 'Blood Sugar Conversion', +// body: Padding( +// padding: const EdgeInsets.all(16.0), +// child: Column( +// //crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Container( +// width: 350.0, +// child: Text( +// 'Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.', +// //textAlign: TextAlign.center, +// style: TextStyle(fontSize: 20.0), +// ), +// ), +// SizedBox( +// height: 15.0, +// ), +// Container( +// color: Colors.white, +// height: 120.0, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Column( +// //crossAxisAlignment: CrossAxisAlignment.end, +// children: [ +// Padding( +// padding: const EdgeInsets.symmetric(horizontal: 15.0), +// child: Row( +// children: [ +// Texts( +// 'Convert from', +// ) +// ], +// ), +// ), +// SizedBox( +// height: 9.0, +// ), +// Row( +// mainAxisAlignment: MainAxisAlignment.spaceEvenly, +// children: [ +// GestureDetector( +// onTap: () { +// setState(() { +// updateColor(1); +// finalValue = textController.text * 3; +// }); +// }, +// child: Container( +// height: 55.0, +// width: 150.0, +// decoration: BoxDecoration( +// color: cardMGColor, +// borderRadius: BorderRadius.circular(10.0), +// ), +// child: Padding( +// padding: const EdgeInsets.symmetric( +// vertical: 0.0, horizontal: 18.0), +// child: Texts('MG/DLt TO \nMMOL/L'), +// ), +// ), +// ), +// GestureDetector( +// onTap: () { +// setState(() { +// updateColor(2); +// finalValue = textController.text * 6; +// }); +// }, +// child: Container( +// height: 55.0, +// width: 150.0, +// decoration: BoxDecoration( +// color: cardMMOLColor, +// borderRadius: BorderRadius.circular(10.0), +// ), +// child: Padding( +// padding: +// const EdgeInsets.symmetric(horizontal: 16.0), +// child: Texts('MG/DLt TO\n MMOL/L'), +// ), +// ), +// ), +// ], +// ), +// ], +// ), +// ), +// ), +// SizedBox( +// height: 25.0, +// ), +// Container( +// height: 55.0, +// color: Colors.white, +// child: TextFormField( +// controller: textController, +// inputFormatters: [ +// FilteringTextInputFormatter.digitsOnly +// ], +// keyboardType: TextInputType.number, +// decoration: InputDecoration( +// labelText: " Enter the reading value", +// ), +// ), +// ), +// SizedBox( +// height: 5.0, +// ), +// Visibility( +// visible: _visible, +// child: Container( +// height: 95.0, +// width: 350.0, +// decoration: BoxDecoration( +// color: Colors.white, +// border: Border.all(color: Colors.black), +// borderRadius: BorderRadius.circular(15.0), +// ), +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// Texts('Result:'), +// Text( +// finalValue.toString(), +// style: TextStyle(fontSize: 35.0), +// ), +// ], +// ), +// ), +// ), +// ), +// SizedBox( +// height: 15.0, +// ), +// Flexible( +// child: Container( +// height: 100.0, +// width: 150.0, +// child: Button( +// label: 'CALCULATE', +// onTap: () { +// setState(() { +// _visible = !_visible; +// }); +// }, +// ), +// ), +// ), +// ], +// ), +// ), +// ); +// } +// } diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart new file mode 100644 index 00000000..66ad31ee --- /dev/null +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -0,0 +1,169 @@ +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:url_launcher/url_launcher.dart'; + +class HospitalsLiveChatPage extends StatefulWidget { + @override + _HospitalsLiveChatPageState createState() => _HospitalsLiveChatPageState(); +} + +class _HospitalsLiveChatPageState extends State { + int tappedIndex; + String chat; + + @override + void initState() { + super.initState(); + tappedIndex = -1; + chat = ""; + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getLiveChatRequestOrders(), + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Column( + children: [ + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + height: 200, + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/dashboard_top_bg.png'), + fit: BoxFit.cover), + ), + child: Texts( + 'You can now talk directly to the appointments department by chat or request a call back\n \nChoose Hospital :', + color: Colors.white, + textAlign: TextAlign.center, + ), + ), + /////////// + ...List.generate( + model.LiveChatModelList.length, + (index) => Container( + margin: + EdgeInsets.only(left: 20, right: 20, bottom: 20), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: tappedIndex == index + ? Colors.red + : Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + setState(() { + tappedIndex = index; + chat = + "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=en&WorkGroup=${model.LiveChatModelList[index].value}"; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 5, right: 5), + child: Texts( + '${model.LiveChatModelList[index].projectName}', + color: + tappedIndex == index + ? Colors.white + : Colors.black, + textAlign: + TextAlign.center, + ))), //model.cOCItemList[index].cOCTitl + Expanded( + flex: 1, + child: Row( + children: [ + IconButton( + icon: Icon( + Icons + .arrow_forward_rounded, + color: + tappedIndex == index + ? Colors.white + : Colors.black, + ), + tooltip: '', + onPressed: () { + setState(() {}); + }, + ), + ], + ), + ), + ], + ), + ), + ], + ), + ) + ], + ), + ), + )), + SizedBox( + height: 100, + ), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.13, + width: double.infinity, + padding: EdgeInsets.all(8.0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: 'ٍStart', + loading: model.state == ViewState.BusyLocal, + onTap: () { + print("chat=" + chat); + launch(chat); + }, + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart new file mode 100644 index 00000000..154a03cd --- /dev/null +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -0,0 +1,117 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'hospitalsLivechat_page.dart'; + +class LiveChatPage extends StatefulWidget { + @override + _LiveChatPageState createState() => _LiveChatPageState(); +} + +class _LiveChatPageState extends State with SingleTickerProviderStateMixin{ + TabController _tabController; + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Locations', + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(' Hospitals '), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(' Pharmacies '), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + HospitalsLiveChatPage(),//SendFeedbackPage(), + PhamaciesLiveChatPage() + //StatusFeedbackPage() + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart new file mode 100644 index 00000000..c56123c9 --- /dev/null +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -0,0 +1,90 @@ +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:url_launcher/url_launcher.dart'; + +class PhamaciesLiveChatPage extends StatefulWidget { + @override + _PhamaciesLiveChatPageState createState() => _PhamaciesLiveChatPageState(); +} + +class _PhamaciesLiveChatPageState extends State { + int tappedIndex; + String chat; + + @override + void initState() + { + super.initState(); + tappedIndex=-1; + chat=""; + } + + @override + + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getLiveChatRequestOrders(), + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15,right: 15), + child: Column( + children: [ + SizedBox(height: 20,), + Container( + width: double.infinity, + height: 200, + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage( + ''), + fit: BoxFit.cover), + ), + child: Texts('You can now talk directly to the pharmacist by chat or request a call back',color: Colors.black,textAlign: TextAlign.center,), + + ), + /////////// + + SizedBox(height: 100,), + + + ], + + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.13, + width: double.infinity, + padding: EdgeInsets.all(8.0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: 'ٍStart', + loading: model.state == ViewState.BusyLocal, + onTap: () { + print("chat="+chat); + chat="http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=1"; + launch(chat); + }, + ), + ), + ), + ), + + ), + ); + + } +} diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart new file mode 100644 index 00000000..e8f52cb9 --- /dev/null +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -0,0 +1,120 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/pages/ContactUs/findus/hospitrals_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/findus/pharmacies_page.dart'; +import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.dart'; +import 'package:diplomaticquarterapp/pages/feedback/status_feedback_page.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + + + +class FindUsPage extends StatefulWidget { + @override + _FindUsPageState createState() => _FindUsPageState(); +} + +class _FindUsPageState extends State with SingleTickerProviderStateMixin{ + TabController _tabController; + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Locations', + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(' Hospitals '), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(' Pharmacies '), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + HospitalsPage(),//SendFeedbackPage(), + PharmaciesPage()//StatusFeedbackPage() + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart new file mode 100644 index 00000000..315fe553 --- /dev/null +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -0,0 +1,184 @@ + +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:giffy_dialog/giffy_dialog.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'package:maps_launcher/maps_launcher.dart'; +class HospitalsPage extends StatefulWidget { + @override + _HospitalsPageState createState() => _HospitalsPageState(); +} + +class _HospitalsPageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getFindUsRequestOrders(),//model.getCOC(), + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15,right: 15,top: 70), + child: Column( + children: [ + ...List.generate(model.FindusHospitalModelList.length, (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + InkWell( + onTap:(){ + showDialog( + context: context,builder: (_) => AssetGiffyDialog( + title: Text(model.FindusHospitalModelList[index].locationName, + style: TextStyle( + fontSize: 22.0, fontWeight: FontWeight.w600), + ),image:Image.network(model.FindusHospitalModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), + buttonCancelText:Text('cancel') , + buttonCancelColor: Colors.grey, + onlyCancelButton: true, + + ) ); + }, + child: Container( + width: 70, + height: 70, + child: Image.network(model.FindusHospitalModelList[index].projectImageURL.toString())), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only(left: 5,right: 5), + child: Texts('${model.FindusHospitalModelList[index].locationName}',textAlign: TextAlign.center,))),//model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, + child: Row( + children: [ + IconButton( + icon: Icon(Icons.person_pin_circle_outlined,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates(double.parse(model.FindusHospitalModelList[index].latitude),double.parse(model.FindusHospitalModelList[index].longitude),model.FindusHospitalModelList[index].locationName); + // _volume += 10; + }); + }, + ), + IconButton( + icon: Icon(Icons.phone,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + ], + ), + ), + + + + ], + ), + ), + + ], + ), + // Texts('${model.FindusHospitalModelList[index].locationName}'), + Divider(height: 4.5,color: Colors.grey[500],) + ], + ), + ), + )), + SizedBox(height: 8,), + Container(width: double.infinity, + height: 100,color: Colors.white, + child: Row( + mainAxisSize:MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + + children: [ + + IconButton( + icon: new Image.asset('assets/images/new-design/youtube.png'), + iconSize: 70, + tooltip: 'Youtube', + onPressed: () { + setState(() { + + launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + + }); + }, + ), + IconButton( + icon: new Image.asset('assets/images/new-design/linkedin.png'), + tooltip: 'LinkedIn', + iconSize: 70, + onPressed: () { + setState(() { + + launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset('assets/images/new-design/twitter.png'), + tooltip: 'Twitter', + iconSize: 70, + onPressed: () { + setState(() { + + launch("https://twitter.com/HMG"); + }); + }, + ), + IconButton( + icon: new Image.asset('assets/images/new-design/facebook.png'), + tooltip: 'facebook', + iconSize: 70, + onPressed: () { + setState(() { + + launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + + ), + ); + + } +} diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart new file mode 100644 index 00000000..f127f842 --- /dev/null +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -0,0 +1,236 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:giffy_dialog/giffy_dialog.dart'; +import 'package:maps_launcher/maps_launcher.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class PharmaciesPage extends StatefulWidget { + @override + _PharmaciesPageState createState() => _PharmaciesPageState(); +} + +class _PharmaciesPageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getFindUsRequestOrders(), //model.getCOC(), + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15, top: 70), + child: Column( + children: [ + ...List.generate( + model.FindusPharmaciesModelList.length, + (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + InkWell( + onTap:(){ + showDialog( + context: context,builder: (_) => AssetGiffyDialog( + title: Text(model.FindusPharmaciesModelList[index].locationName, + style: TextStyle( + fontSize: 22.0, fontWeight: FontWeight.w600), + ),image:Image.network(model.FindusPharmaciesModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), + buttonCancelText:Text('cancel') , + // buttonCancelText:Text(model.user.projectID) , + buttonCancelColor: Colors.grey, + onlyCancelButton: true, + + ) ); + }, + child: Container( + width: 70, + height: 70, + child: Image.network(model + .FindusPharmaciesModelList[ + index] + .projectImageURL + .toString())), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + '${model.FindusPharmaciesModelList[index].locationName}', + textAlign: TextAlign.start, + ), + SizedBox(height: 4,), + Texts( + '${model.FindusPharmaciesModelList[index].cityName}', + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + //model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, + child: Row( + children: [ + IconButton( + icon: Icon( + Icons + .person_pin_circle_outlined, + color: Colors.red, + ), + tooltip: + 'Increase volume by 10', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates( + double.parse(model + .FindusPharmaciesModelList[ + index] + .latitude), + double.parse(model + .FindusPharmaciesModelList[ + index] + .longitude), + model + .FindusPharmaciesModelList[ + index] + .locationName); + // _volume += 10; + }); + }, + ), + IconButton( + icon: Icon( + Icons.phone, + color: Colors.red, + ), + tooltip: + 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + launch("tel://" + + model + .FindusPharmaciesModelList[ + index] + .phoneNumber); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ], + ), + + Divider( + height: 4.5, + color: Colors.grey[500], + ) + ], + ), + ), + )), + SizedBox( + height: 8, + ), + Container( + width: double.infinity, + height: 100, + color: Colors.white, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/youtube.png'), + iconSize: 70, + tooltip: 'Youtube', + onPressed: () { + setState(() { + // _volume += 10; + launch( + "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/linkedin.png'), + tooltip: 'LinkedIn', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/twitter.png'), + tooltip: 'Twitter', + iconSize: 70, + onPressed: () { + setState(() { + launch("https://twitter.com/HMG"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/facebook.png'), + tooltip: 'facebook', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/hmg_service.dart b/lib/pages/ContactUs/hmg_service.dart new file mode 100644 index 00000000..4f19e8f8 --- /dev/null +++ b/lib/pages/ContactUs/hmg_service.dart @@ -0,0 +1,93 @@ +import 'package:diplomaticquarterapp/pages/ContactUs/widgets/card_common_contat.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +import 'package:flutter/material.dart'; +import '../../uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; + +class HmgServicePage extends StatefulWidget { + @override + _HmgServicePageState createState() => _HmgServicePageState(); +} + +class _HmgServicePageState extends State { + + LocationUtils locationUtils; + + @override + void initState() { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + + super.initState(); + } + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true,//widget.isAppbar, + appBarTitle: "HMG Services",//TranslationBase.of(context).bookAppo, + body: Container( + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: CardCommonContact( + image: 'assets/images/new-design/find_us_icon.png', + text: "Find us", + subText: "", + type: 0, + + ), + ), + Expanded( + child: CardCommonContact( + image: 'assets/images/new-design/feedback_icon.png', + text: "Feedback", + subText: "", + type: 1), + + ), + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: CardCommonContact( + image: 'assets/images/new-design/live_chat_icon.png', + text: "Live Chat", + subText: "Service", + type: 2, + + ), + ), + Expanded( + child: Opacity( + opacity: 0, + child: CardCommonContact( + image: 'assets/images/new-design/feedback_icon.png', + text: "Feedback", + subText: "", + type: 3), + ), + + ), + ], + ), + ], + ), + ), + ); + } +} + diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart new file mode 100644 index 00000000..9ad74aff --- /dev/null +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -0,0 +1,71 @@ +import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; + +class CardCommonContact extends StatelessWidget { + final image; + final text; + final subText; + final type; + const CardCommonContact( + {@required this.image, + @required this.text, + @required this.subText, + @required this.type}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + navigateToSearch(context, this.type); + }, + child: Container( + margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), + decoration: BoxDecoration(boxShadow: [ + BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) + ], borderRadius: BorderRadius.circular(10), color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: Text(this.text, + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFFc5272d), + letterSpacing: 1.0, + fontSize: 20.0)), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + child: Text(this.subText, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), + ), + Container( + alignment: Alignment.bottomRight, + margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), + child: Image.asset(this.image, width: 60.0, height: 60.0), + ), + ], + ), + ), + ); + } + + Future navigateToSearch(context, type) async { + + if (type == 0) { + Navigator.push(context, FadePage(page: FindUsPage())); + } else if (type == 1) { + Navigator.push(context, FadePage(page: FeedbackHomePage())); + } else if (type == 2) { + //LiveChatPage + Navigator.push(context, FadePage(page: LiveChatPage())); + + } + } +} diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index e69de29b..9c4dfa29 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -0,0 +1,125 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'dart:ui'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +class AmbulanceReq extends StatefulWidget { + @override + _AmbulanceReqState createState() => _AmbulanceReqState(); +} + +class _AmbulanceReqState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPrescriptions(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: "Ambulance Request", + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.40, + child: Center( + child: Texts("Ambulance Request"),//TranslationBase.of(context).prescriptions + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts("Orders Log"), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PrescriptionsPage( + prescriptionsViewModel: model, + ), + PrescriptionsHistoryPage( + prescriptionsViewModel: model, + ) + ], + ), + ) + ], + ), + ), + ), + ); + } + +} diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 6b6166bb..886d47d2 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -37,12 +37,7 @@ class _ErOptionsState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ -// Text(TranslationBase.of(context).searchBy, -// style: TextStyle( -// fontSize: 24.0, -// letterSpacing: 1.0, -// fontWeight: FontWeight.bold, -// color: new Color(0xFF60686b))), + Container( margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), child: Row( diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index e167770b..227cfb3b 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -51,160 +51,160 @@ class NearestEr extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[0] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[0] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[0].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[0] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[0] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[0] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[0] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[0] - .projectName, + child: Container( + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[0] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[0] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[0].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[0] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[0] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[0] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[0] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[0] + .projectName, + ), ), - flex: 0, + ), Expanded( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[1] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[1] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[1].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[1] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[1] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[1] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[1] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[1] - .projectName, + child: Container( + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[1] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[1] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[1].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[1] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[1] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[1] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[1] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[1] + .projectName, + ), ), - flex: 0, + ) ], ), Row( - mainAxisSize: MainAxisSize.max, + mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: CardPosition( -// mode -// .vitalSignResModelList[ -// mode.vitalSignResModelList.length - 1] -// .heightCm -// .toString() - text: mode - .ProjectAvgERWaitingTimeModeList[2] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', + child: Container( + child: CardPosition( - subText: mode - .ProjectAvgERWaitingTimeModeList[2] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[2].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[2] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[2] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[2] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[2] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[2] - .projectName, + text: mode + .ProjectAvgERWaitingTimeModeList[2] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + + subText: mode + .ProjectAvgERWaitingTimeModeList[2] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[2].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[2] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[2] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[2] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[2] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[2] + .projectName, + ), ), - flex: 0, + ), Expanded( - child: CardPosition( -// mode -// .vitalSignResModelList[ -// mode.vitalSignResModelList.length - 1] -// .heightCm -// .toString() - text: mode - .ProjectAvgERWaitingTimeModeList[3] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', + child: Container( + child: CardPosition( + + text: mode + .ProjectAvgERWaitingTimeModeList[3] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[3] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[3].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[3] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[3] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[3] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[3] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[3] - .projectName, + subText: mode + .ProjectAvgERWaitingTimeModeList[3] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[3].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[3] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[3] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[3] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[3] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[3] + .projectName, + ), ), flex: 0, ) @@ -215,80 +215,80 @@ class NearestEr extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: CardPosition( -// mode -// .vitalSignResModelList[ -// mode.vitalSignResModelList.length - 1] -// .heightCm -// .toString() - text: mode - .ProjectAvgERWaitingTimeModeList[4] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', + child: Container( + child: CardPosition( - subText: mode - .ProjectAvgERWaitingTimeModeList[4] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[4].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[4] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[4] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[4] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[4] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[4] - .projectName, + text: mode + .ProjectAvgERWaitingTimeModeList[4] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + + subText: mode + .ProjectAvgERWaitingTimeModeList[4] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[4].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[4] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[4] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[4] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[4] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[4] + .projectName, + ), ), - flex: 0, + ), Expanded( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[5] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[5] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[5].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[5] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[5] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[5] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[5] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[5] - .projectName, + child: Container( + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[5] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[5] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[5].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[5] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[5] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[5] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[5] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[5] + .projectName, + ), ), - flex: 0, + ) ], ), @@ -297,37 +297,39 @@ class NearestEr extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[6] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[6] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[6].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[6] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[6] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[6] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[6] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[6] - .projectName, + child: Container( + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[6] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[6] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[6].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[6] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[6] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[6] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[6] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[6] + .projectName, + ), ), flex: 0, ), diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart index c65789c5..35ece966 100644 --- a/lib/pages/ErService/widgets/card_common.dart +++ b/lib/pages/ErService/widgets/card_common.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import '../AmbulanceReq.dart'; import '../NearestEr.dart'; class CardCommonEr extends StatelessWidget { @@ -21,7 +22,7 @@ class CardCommonEr extends StatelessWidget { return GestureDetector( onTap: () { navigateToSearch(context, this.type); - print("=============this.type============="+this.type); + }, child: Container( margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), @@ -61,16 +62,15 @@ class CardCommonEr extends StatelessWidget { Future navigateToSearch(context, type) async { //===Switch case=== if(type==0) - {print("========Ambalunce=========");} + { + + Navigator.push( + context, + FadePage( + page: AmbulanceReq())); + } else{ - print("=========Nearest ER==========="); -// Navigator.push( -// context, -// -// FadePage( -// // page: NearestEr(isAppbar: true,))); -// page: NearestEr())); Navigator.push( context, FadePage( @@ -79,11 +79,5 @@ class CardCommonEr extends StatelessWidget { } -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => Search( -// type: type, -// ))); } } diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 4c649fc5..8647ad62 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -40,7 +40,7 @@ class CardPosition extends StatelessWidget { }, child: Container( - width:190, + width:MediaQuery.of(context).size.width * 0.47,//165, margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0), decoration: BoxDecoration(boxShadow: [ BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) @@ -79,10 +79,8 @@ class CardPosition extends StatelessWidget { Future navigateToSearch(context, type,telephone,networkImage,latitude,longitude,projectname) async { -//===Switch case=== - print("================"+type); - print("================"+telephone); - print("================"+networkImage); + + showDialog( context: context,builder: (_) => AssetGiffyDialog( @@ -98,22 +96,6 @@ class CardPosition extends StatelessWidget { onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);}, onCancelButtonPressed :() {launch("tel://" +telephone);} -// double.parse( -// _medicineProvider.pharmaciesList[index]["Latitude"]), -// double.parse( -// _medicineProvider.pharmaciesList[index]["Longitude"]), -// _medicineProvider.pharmaciesList[index] -// ["LocationDescription"]); - //launch("tel://" +telephone); -//================ -// MapsLauncher.launchCoordinates( -// double.parse( -// _medicineProvider.pharmaciesList[index]["Latitude"]), -// double.parse( -// _medicineProvider.pharmaciesList[index]["Longitude"]), -// _medicineProvider.pharmaciesList[index] -// ["LocationDescription"]); -//================= diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 24a6f714..9b702ff3 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -2,9 +2,11 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/hmg_service.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; +import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; @@ -443,52 +445,23 @@ class _HomePageState extends State { SizedBox( height: 8, ), - Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.29, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', - height: 55, - ), - SizedBox( - height: 5, - ), - Texts( - TranslationBase.of(context) - .onlinePaymentService, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 1.9, - ) - ], - ), - ), - ), - height: MediaQuery.of(context).size.width * 0.4, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Colors.white, - ), - ), - Container( + InkWell( + onTap: () => + Navigator.push(context, FadePage(page: PaymentService())), + child: Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.29, child: Center( child: Padding( padding: const EdgeInsets.all(15.0), child: Column( children: [ Image.asset( - 'assets/images/ereferral_service_icon.png', - width: 50, + 'assets/images/al-habib_online_payment_service_icon.png', height: 55, ), SizedBox( @@ -496,7 +469,7 @@ class _HomePageState extends State { ), Texts( TranslationBase.of(context) - .offersAndPackages, + .onlinePaymentService, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -506,54 +479,87 @@ class _HomePageState extends State { ), ), ), - width: MediaQuery.of(context).size.width * 0.29, height: MediaQuery.of(context).size.width * 0.4, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), color: Colors.white, - )), - Container( - width: MediaQuery.of(context).size.width * 0.29, - child: InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: ErOptions( - isAppbar: true, - ))), - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/Dr_Schedule_report.png', - width: 50, - height: 50, - ), - SizedBox( - height: 5, - ), - Texts( - TranslationBase.of(context) - .emergencyServices, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 1.9, - ) - ], + ), + ), + Container( + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/ereferral_service_icon.png', + width: 50, + height: 55, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context) + .offersAndPackages, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 2, + ) + ], + ), + ), + ), + width: MediaQuery.of(context).size.width * 0.29, + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + )), + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: ErOptions( + isAppbar: true, + ))), + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/Dr_Schedule_report.png', + width: 50, + height: 50, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context) + .emergencyServices, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 2.0, + ) + ], + ), ), ), ), + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), ), - height: MediaQuery.of(context).size.width * 0.4, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Colors.white, - ), - ), - ], + ], + ), ), ), SizedBox( @@ -604,8 +610,10 @@ class _HomePageState extends State { ), DashboardItem( onTap: () { + // Navigator.push( + // context, FadePage(page: FeedbackHomePage())); Navigator.push( - context, FadePage(page: FeedbackHomePage())); + context, FadePage(page: HmgServicePage())); }, child: Container( width: double.infinity, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index d892be83..ad8ae6a5 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -11,7 +11,6 @@ import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; -import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; @@ -19,13 +18,10 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:provider/provider.dart'; import 'home_page.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; class LandingPage extends StatefulWidget { static bool isOpenCallPage = false; @@ -110,14 +106,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - _firebaseMessaging.requestNotificationPermissions( -// const IosNotificationSettings( -// sound: true, -// badge: true, -// alert: true, -// provisional: true, -// ), - ); + _firebaseMessaging.requestNotificationPermissions(); } _firebaseMessaging.getToken().then((String token) { @@ -126,10 +115,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { checkUserStatus(token); } requestPermissions(); + }).catchError((err) { + print(err); }); //_firebase Background message handler - _firebaseMessaging.configure( + // _firebaseMessaging.configure( // onMessage: (Map message) async { // showDialog("onMessage: $message"); // print("onMessage: $message"); @@ -219,18 +210,17 @@ class _LandingPageState extends State with WidgetsBindingObserver { // print(route.settings.name); // } // - // Map myMap = - // new Map.from(message); + // Map myMap = new Map.from(message); // print(myMap); // LandingPage.isOpenCallPage = true; // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); // if (!isPageNavigated) { // isPageNavigated = true; // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => IncomingCall( - // incomingCallData: LandingPage.incomingCallData))) + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) // .then((value) { // isPageNavigated = false; // }); @@ -242,7 +232,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { // print("Is Call Not Found iOS"); // } // }, - ); + // ); } showDialog(String message) { diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart new file mode 100644 index 00000000..5cef835f --- /dev/null +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -0,0 +1,396 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.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/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +import '../../../core/model/my_balance/AdvanceModel.dart'; +import 'confirm_payment_page.dart'; +import 'dialogs/SelectBeneficiaryDialog.dart'; +import 'dialogs/SelectPatientFamilyDialog.dart'; +import 'dialogs/SelectPatientInfoDialog.dart'; +import 'new_text_Field.dart'; + +enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + +class AdvancePaymentPage extends StatefulWidget { + @override + _AdvancePaymentPageState createState() => _AdvancePaymentPageState(); +} + +class _AdvancePaymentPageState extends State { + TextEditingController _fileTextController = TextEditingController(); + TextEditingController _notesTextController = TextEditingController(); + BeneficiaryType beneficiaryType = BeneficiaryType.NON; + HospitalsModel _selectedHospital; + String amount = ""; + String email; + PatientInfo _selectedPatientInfo; + AuthenticatedUser authenticatedUser; + GetAllSharedRecordsByStatusList selectedPatientFamily; + AdvanceModel advanceModel = AdvanceModel(); + + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser; + + @override + void initState() { + super.initState(); + getAuthUser(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getHospitals(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).advancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).advancePaymentLabel, + textAlign: TextAlign.center, + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectBeneficiaryDialog(model), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getBeneficiaryType()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + SizedBox( + height: 12, + ), + if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + InkWell( + onTap: () { + model.getFamilyFiles().then((value) { + confirmSelectFamilyDialog(model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList); + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getFamilyMembersName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).fileNumber, + controller: _fileTextController, + ), + if (beneficiaryType == BeneficiaryType.OtherAccount) + SizedBox( + height: 12, + ), + if (beneficiaryType == BeneficiaryType.OtherAccount) + InkWell( + onTap: () { + if (_fileTextController.text.isNotEmpty) + model + .getPatientInfoByPatientID( + id: _fileTextController.text) + .then((value) { + confirmSelectPatientDialog(model.patientInfoList); + }).showProgressBar( + text: "Loading", + backgroundColor: + Colors.blue.withOpacity(0.6)); + else + AppToast.showErrorToast( + message: 'Please Enter The File Number'); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getPatientName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectHospitalDialog(model.hospitals), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getHospitalName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).amount, + keyboardType: TextInputType.number, + onChanged: (value) { + setState(() { + amount = value; + }); + }, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).depositorEmail, + initialValue: model.user.emailAddress, + onChanged: (value) { + email = value; + }, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).notes, + controller: _notesTextController, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.15, + ) + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).submit, + disabled: amount.isEmpty || + _fileTextController.text.isEmpty || + _selectedHospital == null, + onTap: () { + advanceModel.fileNumber = _fileTextController.text; + advanceModel.hospitalsModel = _selectedHospital; + advanceModel.note = _notesTextController.text; + advanceModel.email = email ?? model.user.emailAddress; + advanceModel.amount = amount; + + model.getPatientInfoByPatientIDAndMobileNumber().then((value) { + if (model.state != ViewState.Error && + model.state != ViewState.ErrorLocal) { + Utils.hideKeyboard(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PaymentMethod())).then( + (value) { + Navigator.push( + context, + FadePage( + page: ConfirmPaymentPage( + advanceModel: advanceModel, + selectedPaymentMethod: value, + patientInfoAndMobileNumber: + model.patientInfoAndMobileNumber, + authenticatedUser: authUser, + ), + ), + ); + }, + ); + } + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); + }, + ), + )), + ); + } + + void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { + showDialog( + context: context, + child: SelectBeneficiaryDialog( + beneficiaryType: beneficiaryType, + onValueSelected: (value) { + setState(() { + if (value == BeneficiaryType.MyAccount) { + _fileTextController.text = model.user.patientID.toString(); + advanceModel.depositorName = + model.user.firstName + " " + model.user.lastName; + } else + _fileTextController.text = ""; + + beneficiaryType = value; + }); + }, + ), + ); + } + + void confirmSelectHospitalDialog(List hospitals) { + showDialog( + context: context, + child: SelectHospitalDialog( + hospitals: hospitals, + selectedHospital: _selectedHospital, + onValueSelected: (value) { + setState(() { + _selectedHospital = value; + }); + }, + ), + ); + } + + void confirmSelectPatientDialog(List patientInfoList) { + showDialog( + context: context, + child: SelectPatientInfoDialog( + patientInfoList: patientInfoList, + selectedPatientInfo: _selectedPatientInfo, + onValueSelected: (value) { + setState(() { + advanceModel.depositorName = value.fullName; + _selectedPatientInfo = value; + }); + }, + ), + ); + } + + void confirmSelectFamilyDialog( + List getAllSharedRecordsByStatusList) { + showDialog( + context: context, + child: SelectPatientFamilyDialog( + getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, + selectedPatientFamily: selectedPatientFamily, + onValueSelected: (value) { + setState(() { + selectedPatientFamily = value; + _fileTextController.text = + selectedPatientFamily.patientID.toString(); + advanceModel.depositorName = value.patientName; + }); + }, + ), + ); + } + + String getBeneficiaryType() { + switch (beneficiaryType) { + case BeneficiaryType.MyAccount: + return TranslationBase.of(context).myAccount; + case BeneficiaryType.MyFamilyFiles: + return TranslationBase.of(context).myFamilyFiles; + break; + case BeneficiaryType.OtherAccount: + return TranslationBase.of(context).otherAccount; + break; + case BeneficiaryType.NON: + return TranslationBase.of(context).selectBeneficiary; + } + return TranslationBase.of(context).selectBeneficiary; + } + + String getHospitalName() { + if (_selectedHospital != null) + return _selectedHospital.name; + else + return TranslationBase.of(context).selectHospital; + } + + String getPatientName() { + if (_selectedPatientInfo != null) + return _selectedPatientInfo.fullName; + else + return TranslationBase.of(context).selectPatientName; + } + + getAuthUser() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + } + } + + String getFamilyMembersName() { + if (selectedPatientFamily != null) + return selectedPatientFamily.patientName; + else + return TranslationBase.of(context).selectFamilyPatientName; + } +} diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart new file mode 100644 index 00000000..cc5df0a6 --- /dev/null +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -0,0 +1,306 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +import 'dialogs/ConfirmSMSDialog.dart'; +import 'new_text_Field.dart'; + +class ConfirmPaymentPage extends StatelessWidget { + final AdvanceModel advanceModel; + final PatientInfoAndMobileNumber patientInfoAndMobileNumber; + final String selectedPaymentMethod; + MyInAppBrowser browser; + AuthenticatedUser authenticatedUser; + AppSharedPreferences sharedPref = AppSharedPreferences(); + + ConfirmPaymentPage( + {this.advanceModel, + this.patientInfoAndMobileNumber, + this.selectedPaymentMethod, + this.authenticatedUser}); + + @override + Widget build(BuildContext context) { + void showSMSDialog() { + showDialog( + context: context, + barrierDismissible: false, + child: ConfirmSMSDialog( + phoneNumber: patientInfoAndMobileNumber.mobileNumber, + ), + ).then((value) { + print("dialog dismissed"); + print(value); + if (value != null && value) { + AppoitmentAllHistoryResultList appo = + new AppoitmentAllHistoryResultList(); + appo.projectID = patientInfoAndMobileNumber.projectID; + openPayment(selectedPaymentMethod, authenticatedUser, + double.parse(advanceModel.amount), appo); + } + }); + } + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).advancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).confirmThePayment, + textAlign: TextAlign.center, + fontWeight: FontWeight.w500, + fontSize: 24, + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + height: 100.0, + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width * 0.45, + child: Image.asset(getImagePath(selectedPaymentMethod)), + ), + Texts( + '${advanceModel.amount} SAR', + fontSize: 26, + bold: true, + ) + ], + ), + SizedBox( + height: 12, + ), + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(3), + child: NewTextFields( + hintText: TranslationBase.of(context).fileNumber, + initialValue: advanceModel.fileNumber, + isEnabled: false, + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(3), + child: NewTextFields( + hintText: TranslationBase.of(context).name, + initialValue: patientInfoAndMobileNumber.firstName, + isEnabled: false, + ), + ), + ), + ], + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).mobileNumber, + initialValue: patientInfoAndMobileNumber.mobileNumber, + isEnabled: false, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).depositorName, + initialValue: advanceModel.depositorName, + isEnabled: false, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: TranslationBase.of(context).notes, + initialValue: advanceModel.note, + isEnabled: false, + ), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).confirm.toUpperCase(), + disabled: model.state == ViewState.Busy, + onTap: () { + model + .sendActivationCodeForAdvancePayment( + patientID: int.parse(advanceModel.fileNumber), + projectID: advanceModel.hospitalsModel.iD) + .then((value) { + if (model.state != ViewState.ErrorLocal && + model.state != ViewState.Error) showSMSDialog(); + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); + }, + ), + ), + ), + ); + } + + String getImagePath(String paymentMethod) { + switch (paymentMethod) { + case "MADA": + return 'assets/images/new-design/mada.png'; + break; + case "SADAD": + return 'assets/images/new-design/sadad.png'; + break; + case "VISA": + return 'assets/images/new-design/visa.png'; + break; + case "MASTERCARD": + return 'assets/images/new-design/mastercard.png'; + break; + case "Installment": + return 'assets/images/new-design/installment.png'; + break; + } + + return 'assets/images/new-design/mada.png'; + } + + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, + double amount, AppoitmentAllHistoryResultList appo) { + browser = new MyInAppBrowser( + onExitCallback: onBrowserExit, + appo: appo, + onLoadStartCallback: onBrowserLoadStart); + + browser.openPaymentBrowser( + amount, + "Advance Payment", + Utils.getAdvancePaymentTransID( + authenticatedUser.projectID, authenticatedUser.patientID), + appo.projectID.toString(), + authenticatedUser.emailAddress, + paymentMethod, + authenticatedUser, + browser); + } + + onBrowserLoadStart(String url) { + print("onBrowserLoadStart"); + print(url); + + MyInAppBrowser.successURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = true; + return; + } + }); + + MyInAppBrowser.errorURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = false; + return; + } + }); + } + + onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { + print("onBrowserExit Called!!!!"); + if (isPaymentMade) checkPaymentStatus(appo); + } + + checkPaymentStatus(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + service + .checkPaymentStatus( + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + AppGlobal.context) + .then((res) { + print("Printing Payment Status Reponse!!!!"); + print(res); + String paymentInfo = res['Response_Message']; + if (paymentInfo == 'Success') { + createAdvancePayment(res, appo); + } else { + AppToast.showErrorToast(message: res['Response_Message']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + String paymentReference = res['Fort_id'].toString(); + service + .createAdvancePayment(appo, res['Amount'], res['Fort_id'], + res['PaymentMethod'], AppGlobal.context) + .then((res) { + print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); + addAdvancedNumberRequest( + res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + addAdvancedNumberRequest(String advanceNumber, String paymentReference, + String appointmentID, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + service + .addAdvancedNumberRequest( + advanceNumber, paymentReference, appointmentID, AppGlobal.context) + .then((res) { + print(res); + navigateToHome(AppGlobal.context); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + Future navigateToHome(context) async { + Navigator.of(context).pushNamed(HOME); + } + +} diff --git a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart new file mode 100644 index 00000000..8dd2b29e --- /dev/null +++ b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart @@ -0,0 +1,375 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class ConfirmSMSDialog extends StatefulWidget { + final String phoneNumber; + final AdvanceModel advanceModel; + final PatientInfoAndMobileNumber patientInfoAndMobileNumber; + final String selectedPaymentMethod; + + const ConfirmSMSDialog( + {Key key, + this.phoneNumber, + this.advanceModel, + this.selectedPaymentMethod, + this.patientInfoAndMobileNumber}) + : super(key: key); + + @override + _ConfirmSMSDialogState createState() => _ConfirmSMSDialogState(); +} + +class _ConfirmSMSDialogState extends State { + final verifyAccountForm = GlobalKey(); + Map verifyAccountFormValue = { + 'digit1': null, + 'digit2': null, + 'digit3': null, + 'digit4': null, + }; + + TextEditingController digit1 = TextEditingController(text: ""); + TextEditingController digit2 = TextEditingController(text: ""); + TextEditingController digit3 = TextEditingController(text: ""); + TextEditingController digit4 = TextEditingController(text: ""); + + String timerText = (TIMER_MIN - 1).toString() + ':59'; + int min = TIMER_MIN - 1; + int sec = 59; + Timer _timer; + + resendCode() { + min = TIMER_MIN - 1; + sec = 59; + _timer = Timer.periodic(Duration(seconds: 1), (Timer timer) { + if (min <= 0 && sec <= 0) { + timer.cancel(); + } else { + setState(() { + sec = sec - 1; + if (sec == 0 && min == 0) { + Navigator.pop(context); + min = 0; + sec = 0; + } else if (sec == 0) { + min = min - 1; + sec = 59; + } + timerText = min.toString() + ':' + sec.toString(); + }); + } + }); + } + + FocusNode focusD1; + FocusNode focusD2; + FocusNode focusD3; + FocusNode focusD4; + + @override + void initState() { + super.initState(); + resendCode(); + focusD1 = FocusNode(); + focusD2 = FocusNode(); + focusD3 = FocusNode(); + focusD4 = FocusNode(); + } + + @override + void dispose() { + _timer.cancel(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => Dialog( + elevation: 0.6, + child: Container( + height: 520, + child: ListView( + children: [ + Container( + width: double.infinity, + height: 40, + color: Colors.grey[700], + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 4, + child: Center( + child: Texts( + 'SMS', + color: Colors.white, + textAlign: TextAlign.center, + ))), + Expanded( + flex: 1, + child: InkWell( + onTap: () => Navigator.pop(context), + child: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.white), + child: Icon( + Icons.clear, + color: Colors.grey[900], + )), + ), + ) + ], + ), + ), + Image.asset( + 'assets/images/login/103.png', + height: MediaQuery.of(context).size.width * 0.25, + width: MediaQuery.of(context).size.width * 0.25, + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).pleaseEnterTheVerificationCode + + '[${widget.phoneNumber}]', + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + Form( + key: verifyAccountForm, + child: Container( + width: SizeConfig.realScreenWidth * 0.90, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + width: 65, + child: TextFormField( + textInputAction: TextInputAction.next, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + focusNode: focusD1, + maxLength: 1, + controller: digit1, + textAlign: TextAlign.center, + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + onSaved: (val) { + verifyAccountFormValue['digit1'] = val; + }, + validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD2); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context).requestFocus(focusD2); + } + }, + ), + ), + Container( + width: 65, + child: TextFormField( + focusNode: focusD2, + controller: digit2, + textInputAction: TextInputAction.next, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit2'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context).requestFocus(focusD3); + } + }, + ), + ), + Container( + width: 65, + child: TextFormField( + focusNode: focusD3, + controller: digit3, + textInputAction: TextInputAction.next, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit3'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + } + }, + )), + Container( + width: 65, + child: TextFormField( + focusNode: focusD4, + controller: digit4, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit4'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD4); + submit(model); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + submit(model); + } + }), + ) + ], + ), + SizedBox( + height: 8, + ), + if (model.state == ViewState.ErrorLocal || + model.state == ViewState.Error) + Container( + margin: EdgeInsets.only(left: 8, right: 8), + width: double.maxFinite, + child: Texts( + model.error, + color: Colors.red, + ), + ), + SizedBox(height: 20), + // buildText(), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context) + .theVerificationCodeExpiresIn + + ' $timerText', + textAlign: TextAlign.center, + ), + ), + SizedBox(height: 20), + + Container( + width: double.maxFinite, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: + TranslationBase.of(context).submit.toUpperCase(), + onTap: () { + submit(model); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + ); + } + + void submit(MyBalanceViewModel model) { + if (verifyAccountForm.currentState.validate()) { + final activationCode = + digit1.text + digit2.text + digit3.text + digit4.text; + model + .checkActivationCodeForAdvancePayment(activationCode: activationCode) + .then((value) {}) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + Navigator.pop(context, true); + }); + } + } + + String validateCodeDigit(value) { + if (value.isEmpty) { + return ''; + } + return null; + } + + InputDecoration buildInputDecoration(BuildContext context) { + return InputDecoration( + // ts/images/password_icon.png + contentPadding: EdgeInsets.only(top: 20, bottom: 20), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5)), + borderSide: BorderSide(color: Colors.black), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).primaryColor), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart new file mode 100644 index 00000000..17bee4b0 --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart @@ -0,0 +1,176 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../advance_payment_page.dart'; + +class SelectBeneficiaryDialog extends StatefulWidget { + final BeneficiaryType beneficiaryType; + final Function(BeneficiaryType) onValueSelected; + + SelectBeneficiaryDialog( + {Key key, this.beneficiaryType, this.onValueSelected}); + + @override + _SelectBeneficiaryDialogState createState() => + _SelectBeneficiaryDialogState(this.beneficiaryType); +} + +class _SelectBeneficiaryDialogState extends State { + _SelectBeneficiaryDialogState(this.beneficiaryType); + + BeneficiaryType beneficiaryType; + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.MyAccount; + }); + }, + child: ListTile( + title: Text(TranslationBase.of(context).myAccount), + leading: Radio( + value: BeneficiaryType.MyAccount, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.MyFamilyFiles; + }); + }, + child: ListTile( + title: Text(TranslationBase.of(context).myFamilyFiles), + leading: Radio( + value: BeneficiaryType.MyFamilyFiles, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.OtherAccount; + }); + }, + child: ListTile( + title: Text(TranslationBase.of(context).otherAccount), + leading: Radio( + value: BeneficiaryType.OtherAccount, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart new file mode 100644 index 00000000..9a4a359d --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectHospitalDialog extends StatefulWidget { + final List hospitals; + final Function(HospitalsModel) onValueSelected; + HospitalsModel selectedHospital; + + SelectHospitalDialog( + {Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); + + @override + _SelectHospitalDialogState createState() => _SelectHospitalDialogState(); +} + +class _SelectHospitalDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.hospitals.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedHospital = widget.hospitals[index]; + }); + }, + child: ListTile( + title: Text(widget.hospitals[index].name + + ' ${widget.hospitals[index].distanceInKilometers} KM'), + leading: Radio( + value: widget.hospitals[index], + groupValue: widget.selectedHospital, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedHospital = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedHospital); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart new file mode 100644 index 00000000..5808aed8 --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart @@ -0,0 +1,130 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectPatientFamilyDialog extends StatefulWidget { + final List getAllSharedRecordsByStatusList; + final Function(GetAllSharedRecordsByStatusList) onValueSelected; + GetAllSharedRecordsByStatusList selectedPatientFamily; + + SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected,this.selectedPatientFamily}); + + @override + _SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState(); +} + +class _SelectPatientFamilyDialogState extends State { + + @override + void initState() { + super.initState(); + widget.selectedPatientFamily = widget.selectedPatientFamily?? widget.getAllSharedRecordsByStatusList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.getAllSharedRecordsByStatusList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedPatientFamily = widget.getAllSharedRecordsByStatusList[index]; + }); + }, + child: ListTile( + title: Text(widget.getAllSharedRecordsByStatusList[index].patientName), + leading: Radio( + value: widget.getAllSharedRecordsByStatusList[index], + groupValue: widget.selectedPatientFamily, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedPatientFamily = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedPatientFamily); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart new file mode 100644 index 00000000..bea4f694 --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart @@ -0,0 +1,130 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectPatientInfoDialog extends StatefulWidget { + final List patientInfoList ; + final Function(PatientInfo) onValueSelected; + PatientInfo selectedPatientInfo; + + SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected,this.selectedPatientInfo}); + + @override + _SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState(); +} + +class _SelectPatientInfoDialogState extends State { + + @override + void initState() { + super.initState(); + widget.selectedPatientInfo = widget.selectedPatientInfo?? widget.patientInfoList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.patientInfoList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedPatientInfo = widget.patientInfoList[index]; + }); + }, + child: ListTile( + title: Text(widget.patientInfoList[index].fullName), + leading: Radio( + value: widget.patientInfoList[index], + groupValue: widget.selectedPatientInfo, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedPatientInfo = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedPatientInfo); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart new file mode 100644 index 00000000..446333cc --- /dev/null +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -0,0 +1,107 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'advance_payment_page.dart'; + +class MyBalancePage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).myBalances, + body: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).balanceAmount, + color: Colors.black, + bold: true, + ), + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(8), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + color: Hexcolor('#B61422'), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).totalBalance, + color: Colors.white, + ), + Texts( + '${model.totalAdvanceBalanceAmount ?? 0} SAR', + color: Colors.white, + bold: true, + ), + ], + ), + ), + SizedBox( + height: 9, + ), + ...List.generate( + model.patientAdvanceBalanceAmountList.length, + (index) => Container( + padding: EdgeInsets.all(8), + height: 65, + margin: EdgeInsets.only(top: 8), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(model.patientAdvanceBalanceAmountList[index] + .projectDescription), + Texts( + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} SAR', + bold: true, + ), + ], + ), + ), + ), + ], + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + // color: Colors.grey[900], + textColor: Colors.white, + label: TranslationBase.of(context).createAdvancedPayment, + onTap: () { + Navigator.push(context, + FadePage(page: AdvancePaymentPage())); + }, + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/balance/new_text_Field.dart b/lib/pages/medical/balance/new_text_Field.dart new file mode 100644 index 00000000..ad9eb580 --- /dev/null +++ b/lib/pages/medical/balance/new_text_Field.dart @@ -0,0 +1,239 @@ +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class NumberTextInputFormatter extends TextInputFormatter { + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { + final int newTextLength = newValue.text.length; + int selectionIndex = newValue.selection.end; + int usedSubstringIndex = 0; + final StringBuffer newText = StringBuffer(); + if (newTextLength >= 1) { + newText.write('('); + if (newValue.selection.end >= 1) selectionIndex++; + } + if (newTextLength >= 4) { + newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); + if (newValue.selection.end >= 3) selectionIndex += 2; + } + if (newTextLength >= 7) { + newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); + if (newValue.selection.end >= 6) selectionIndex++; + } + if (newTextLength >= 11) { + newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); + if (newValue.selection.end >= 10) selectionIndex++; + } + // Dump the rest. + if (newTextLength >= usedSubstringIndex) + newText.write(newValue.text.substring(usedSubstringIndex)); + return TextEditingValue( + text: newText.toString(), + selection: TextSelection.collapsed(offset: selectionIndex), + ); + } +} + +final _mobileFormatter = NumberTextInputFormatter(); + +class NewTextFields extends StatefulWidget { + NewTextFields( + {Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.hintColor,this.isEnabled=true}) + : super(key: key); + + final String hintText; + + // final String initialValue; + final String type; + final bool autoFocus; + final IconData suffixIcon; + final Color suffixIconColor; + final Icon prefixIcon; + final VoidCallback onTap; + final TextEditingController controller; + final TextInputType keyboardType; + final FormFieldValidator validator; + final Function onSaved; + final Function onSuffixTap; + final Function onChanged; + final Function onSubmit; + final bool readOnly; + final int maxLength; + final int minLines; + final int maxLines; + final bool maxLengthEnforced; + final bool bare; + final bool isEnabled; + final TextInputAction inputAction; + final double fontSize; + final FontWeight fontWeight; + final bool keepPadding; + final TextCapitalization textCapitalization; + final List inputFormatters; + final bool autoValidate; + final EdgeInsets padding; + final bool focus; + final bool borderOnlyError; + final Color hintColor; + final String initialValue; + @override + _NewTextFieldsState createState() => _NewTextFieldsState(); +} + +class _NewTextFieldsState extends State { + final FocusNode _focusNode = FocusNode(); + bool focus = false; + bool view = false; + + @override + void initState() { + super.initState(); + _focusNode.addListener(() { + setState(() { + focus = _focusNode.hasFocus; + }); + }); + } + + @override + void didUpdateWidget(NewTextFields oldWidget) { + if (widget.focus) _focusNode.requestFocus(); + super.didUpdateWidget(oldWidget); + } + + @override + void dispose() { + _focusNode.dispose(); + super.dispose(); + } + + + bool _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly) { + _focusNode.unfocus(); + return true; + } else { + return false; + } + } + + @override + Widget build(BuildContext context) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Container( + margin: EdgeInsets.only(top: 8), + + child: TextFormField( + enabled: widget.isEnabled, + initialValue: widget.initialValue, + keyboardAppearance: Theme.of(context).brightness, + scrollPhysics: BouncingScrollPhysics(), + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) + : widget.onSubmit, + textInputAction: widget.inputAction, + minLines: widget.minLines ?? 1, + maxLines: widget.maxLines ?? 1, + maxLengthEnforced: widget.maxLengthEnforced, + onChanged: widget.onChanged, + focusNode: _focusNode, + maxLength: widget.maxLength ?? null, + controller: widget.controller, + keyboardType: widget.keyboardType, + readOnly: _determineReadOnly(), + obscureText: widget.type == "password" && !view ? true : false, + autofocus: widget.autoFocus ?? false, + validator: widget.validator, + onSaved: widget.onSaved, + + style: Theme.of(context) + .textTheme + .body2 + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone + ? [ + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] + : widget.inputFormatters, + decoration: InputDecoration( + labelText: widget.hintText, + labelStyle: TextStyle(color: Colors.black), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(8.0)), + focusedBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + disabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + enabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 7abd724d..79c5571d 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -24,6 +24,7 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; import 'package:provider/provider.dart'; import '../../locator.dart'; +import 'balance/my_balance_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'; @@ -42,7 +43,7 @@ class _MedicalProfilePageState extends State { onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, - body: SafeArea( + body: Container( child: SingleChildScrollView( child: Column( children: [ @@ -368,10 +369,10 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( -// onTap: () { -// Navigator.push( -// context, FadePage(page: InsuranceApproval())); -// }, + onTap: () { + Navigator.push(context, + FadePage(page: MyBalancePage())); + }, child: MedicalProfileItem( title: TranslationBase.of(context).myBalance, diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart new file mode 100644 index 00000000..15a1f699 --- /dev/null +++ b/lib/pages/paymentService/payment_service.dart @@ -0,0 +1,151 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class PaymentService extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).paymentService, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: InkWell( + onTap: () => Navigator.push( + context, FadePage(page: AdvancePaymentPage())), + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).payment, + color: Hexcolor('#B61422'), + bold: true, + ), + Texts( + TranslationBase.of(context).paymentOnline, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + Image.asset( + 'assets/images/al-habib_online_payment_service_icon.png', + fit: BoxFit.fill, + height: 55, + width: double.infinity, + ), + ], + ), + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).onlineCheckIn, + color: Hexcolor('#B61422'), + bold: true, + ), + Texts( + TranslationBase.of(context).appointment, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + Align( + alignment: projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Image.asset( + 'assets/images/al-habib_online_payment_service_icon.png', + height: 55, + ), + ), + ], + ), + ), + ) + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: InkWell( + onTap: () => Navigator.push( + context, FadePage(page: MyBalancePage())), + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'My Balances', + color: Hexcolor('#B61422'), + bold: true, + ), + Texts( + TranslationBase.of(context).payment, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + Align( + alignment: projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Image.asset( + 'assets/images/al-habib_online_payment_service_icon.png', + height: 55, + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Container(), + ) + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 8cc1e469..61c5ad59 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -148,7 +148,8 @@ class ClinicListService extends BaseService { "isDentalAllowedBackend": true, "Latitude": lat.toString(), "Longitude": long.toString(), - "DeviceTypeID": 1 + "DeviceTypeID": req.DeviceTypeID, + "IsPublicRequest" : true }; dynamic localRes; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 3a4d8bc1..310b1bdd 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -587,6 +587,50 @@ class TranslationBase { localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; String get myVaccinesAvailability => localizedValues['MyVaccinesAvailability'][locale.languageCode]; + String get paymentService => + localizedValues['PaymentService'][locale.languageCode]; + String get paymentOnline => + localizedValues['PaymentOnline'][locale.languageCode]; + String get onlineCheckIn => + localizedValues['OnlineCheckIn'][locale.languageCode]; + String get myBalances => localizedValues['MyBalances'][locale.languageCode]; + String get balanceAmount => + localizedValues['BalanceAmount'][locale.languageCode]; + String get totalBalance => + localizedValues['TotalBalance'][locale.languageCode]; + String get createAdvancedPayment => + localizedValues['CreateAdvancedPayment'][locale.languageCode]; + String get advancePayment => + localizedValues['AdvancePayment'][locale.languageCode]; + String get advancePaymentLabel => + localizedValues['AdvancePaymentLabel'][locale.languageCode]; + String get fileNumber => localizedValues['FileNumber'][locale.languageCode]; + String get amount => localizedValues['Amount'][locale.languageCode]; + String get depositorEmail => + localizedValues['DepositorEmail'][locale.languageCode]; + String get notes => localizedValues['Notes'][locale.languageCode]; + String get selectPatientName => + localizedValues['SelectPatientName'][locale.languageCode]; + String get selectFamilyPatientName => + localizedValues['SelectFamilyPatientName'][locale.languageCode]; + String get selectHospital => + localizedValues['SelectHospital'][locale.languageCode]; + String get myAccount => localizedValues['MyAccount'][locale.languageCode]; + String get otherAccount => + localizedValues['OtherAccount'][locale.languageCode]; + String get selectBeneficiary => + localizedValues['SelectBeneficiary'][locale.languageCode]; + String get confirmThePayment => + localizedValues['ConfirmThePayment'][locale.languageCode]; + String get depositorName => + localizedValues['DepositorName'][locale.languageCode]; + String get mobileNumber => + localizedValues['MobileNumber'][locale.languageCode]; + String get ok => localizedValues['Ok'][locale.languageCode]; + String get theVerificationCodeExpiresIn => + localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; + String get pleaseEnterTheVerificationCode => + localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 6958e67f..b78e5d11 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -96,6 +96,14 @@ class Utils { appoNo.toString(); } + static String getAdvancePaymentTransID(int projectID, int fileNumber) { + return projectID.toString() + + '-' + + fileNumber.toString() + + '-' + + DateTime.now().millisecondsSinceEpoch.toString(); + } + bool validateIDBox(String value, type) { Pattern pattern = loginIDPattern(type); //r'^\d+(?:\.\d+)?$'; diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 0432dc90..b7c4a185 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -41,6 +41,7 @@ class DoctorCard extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(8.0), ), + color: Colors.white ), child: InkWell( onTap: onTap, diff --git a/lib/widgets/data_display/services)contaniner.dart b/lib/widgets/data_display/services)contaniner.dart new file mode 100644 index 00000000..91b0b59d --- /dev/null +++ b/lib/widgets/data_display/services)contaniner.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; + +class ServicesContainer extends StatelessWidget { + final String title; + final String imageLocation; + final Function onTap; + + ServicesContainer({this.title, this.imageLocation, this.onTap}); + @override + Widget build(BuildContext context) { + return InkWell( + onTap: () => onTap(), + child: Container( + height: 60, + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Image.asset( + imageLocation, + height: 30, + width: 40, + ), + SizedBox( + width: 20, + ), + Texts( + title, + fontSize: 16, + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 64b3ac1f..9b9588fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: giffy_dialog: ^1.8.0 # Flutter Html View - flutter_html: ^1.0.2 + flutter_html: 1.0.2 # Native flutter_device_type: ^0.2.0