diff --git a/assets/images/cc_ar.png b/assets/images/cc_ar.png
new file mode 100644
index 00000000..e4388ba2
Binary files /dev/null and b/assets/images/cc_ar.png differ
diff --git a/assets/images/cc_en.png b/assets/images/cc_en.png
new file mode 100644
index 00000000..c11cf5e6
Binary files /dev/null and b/assets/images/cc_en.png differ
diff --git a/assets/images/new/direction.svg b/assets/images/new/direction.svg
new file mode 100644
index 00000000..05d10bc2
--- /dev/null
+++ b/assets/images/new/direction.svg
@@ -0,0 +1,8 @@
+
diff --git a/assets/images/new/passport.svg b/assets/images/new/passport.svg
new file mode 100644
index 00000000..883287fb
--- /dev/null
+++ b/assets/images/new/passport.svg
@@ -0,0 +1,14 @@
+
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index dc5c209a..4f76996c 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -86,8 +86,10 @@ const Map localizedValues = {
'instruction': {'en': 'Instructions', 'ar': 'تعليمات'},
'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'},
'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'},
+ 'agreeTo': {'en': 'I agree the', 'ar': 'أوافق على'},
+ 'termsConditoins': {'en': 'Terms and Conditions', 'ar': 'الأحكام والشروط'},
'cancelAppoMsg': {'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'},
-
+ 'changePayment': {'en': 'Change Payment Method', 'ar': 'قم بتغيير آلية الدفع'},
'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يوجد إجراء مطلوب'},
'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'},
"book-success-confirm-more-24-1-2": {"en": "The online payment process will be available 24 hours before the appointment.", "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة."},
@@ -907,17 +909,15 @@ const Map localizedValues = {
"RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"},
"Rapid-Response-Team": {"en": "Rapid Response Team", "ar": "فريق الاستجابة السريع"},
"AmountBeforeTax": {"en": "Amount Before Tax:", "ar": "Amount Before Tax:"},
- "ApproximateServiceFee": {"en": "Approximate Service Fee", "ar": "Approximate Service Fee"},
+ "ApproximateServiceFee": {"en": "Service fee starting from", "ar": "تبدأ رسوم الخدمة من"},
"TaxAmount": {"en": "Tax Amount:", "ar": "Tax Amount:"},
"somethingWentWrongTryLater": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا"},
"TotalAmountPayable": {"en": "Total Amount Payable:", "ar": "Total Amount Payable:"},
- "iAcceptTermsConditions": {"en": "I Accept the Terms And Conditions", "ar": "You can pay by the following options:"},
- "YouCanPayByTheFollowingOptions": {"en": "You can pay by the following options:", "ar": "I Accept the Terms And Conditions"},
+ "iAcceptTermsConditions": {"en": "I Accept the Terms And Conditions", "ar": "أوافق على الشروط والأحكام"},
+ "YouCanPayByTheFollowingOptions": {"en": "You can pay by the following Options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"},
"RRTDDetails": {
- "en":
- "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a complete medical team at home",
- "ar":
- "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a complete medical team at home"
+ "en": "The RRT service provides medical service for urgent and stable cases, not life-threatening situations or extremities, and the service includes providing medical care from a complete medical team at home.",
+ "ar": "توفر خدمة فريق الاستجابة السريع RRT خدمه طبيه للحالات المستعجله والمستقره وليست الحالات المهدده للحياه او الاطراف ، وتشمل الخدمه تقديم رعايه طبيه من فريق طبي متكامل بالمنزل."
},
"rrtService": {"en": "RRT Service", "ar": "خدمة RRT"},
"bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"},
@@ -1511,5 +1511,11 @@ const Map localizedValues = {
"covidBookAppo": { "en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: " },
"emptySchedule": { "en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب" },
"serviceNotAvailable": { "en": "Dear, this service is not available now, please try again later", "ar": "عزيزي المراجع, هذه الخدمة غير متوفرة الان يرجى المحاوله لاحقا"},
- "doctorScheduleNot": {"en": "Doctor schedule not available", "ar": "جدول الطبيب غير متوفر"}
+ "doctorScheduleNot": {"en": "Doctor schedule not available", "ar": "جدول الطبيب غير متوفر"},
+ "RRTRequestSuccess": { "en": "Request has been sent successfully, You will be contacted soon.", "ar": "تم إرسال الطلب بنجاح ، وسيتم الاتصال بك باسرع وقت ممكن" },
+ "rateDoctorAppo": { "en": "Rate DR & Appointment", "ar": "معدل الدكتور والتعيين" },
+ "invoice": { "en": "Invoice", "ar": "الفاتورة" },
+ "requestedDate": { "en": "Reqeusted Date", "ar": "التاريخ " },
+ "callDuration": { "en": "Call Duration", "ar": "مدة الاتصال" },
+ "alreadyRated": { "en": "This appointment has been previously evaluated.", "ar": "تم تقييم هذا الموعد مسبقاً" },
};
diff --git a/lib/core/model/prescriptions/prescriptions_order.dart b/lib/core/model/prescriptions/prescriptions_order.dart
index 646957ac..fe4239ba 100644
--- a/lib/core/model/prescriptions/prescriptions_order.dart
+++ b/lib/core/model/prescriptions/prescriptions_order.dart
@@ -45,7 +45,7 @@ class PrescriptionsOrder {
return '$status';
}
- String getFormattedDateTime()=> DateUtil.getDateFormatted(pickupDateTime);
+ String getFormattedDateTime()=> DateUtil.getWeekDayMonthDayYearDateFormatted(createdOn, isAppArabic ? 'ar' : 'en');
PrescriptionsOrder(
{this.iD,
diff --git a/lib/core/service/medical/ActiveMedicationsService.dart b/lib/core/service/medical/ActiveMedicationsService.dart
index dc4a3641..0025df29 100644
--- a/lib/core/service/medical/ActiveMedicationsService.dart
+++ b/lib/core/service/medical/ActiveMedicationsService.dart
@@ -12,7 +12,6 @@ class ActiveMedicationsService extends BaseService{
Map body = Map();
body['isDentalAllowedBackend'] = false;
body['PatientID'] = 1298851;
- body['TokenID'] = "@dm!n";
await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID,
onSuccess: (response, statusCode) async {
activePrescriptionReport.clear();
diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart
index f4405a92..d8705ae8 100644
--- a/lib/core/viewModels/er/rrt-view-model.dart
+++ b/lib/core/viewModels/er/rrt-view-model.dart
@@ -44,6 +44,8 @@ class RRTViewModel extends BaseViewModel {
body['CreatedBy'] = user.patientIdentificationType;
body['OrderServiceID'] = 5;
+ var localRes;
+
int requestNo;
await _service.baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, body: body, onSuccess: (response, statusCode) {
requestNo = response['RequestNo'];
@@ -57,18 +59,20 @@ class RRTViewModel extends BaseViewModel {
Future<_RRTServiceData> getAllOrders() async {
await _service.baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, body: {}, onSuccess: (response, statusCode) {
var data = response["PatientER_GetPatientAllPresOrdersList"];
+ rrtServiceData.completedOrders.clear();
+ rrtServiceData.pendingOrders.clear();
if (data != null && data is List) {
data.forEach((json) {
if (json["ServiceID"] == 5) {
- if (json["Status"] == 1) {
+ if (json["Status"] == 1 || json["Status"] == 2) {
// Pending
- rrtServiceData.pendingOrders.clear();
rrtServiceData.pendingOrders.add(PrescriptionsOrder.fromJson(json));
- } else if (json["Status"] == 3) {
- // Completed
- rrtServiceData.completedOrders.clear();
- rrtServiceData.completedOrders.add(PrescriptionsOrder.fromJson(json));
}
+ // else if (json["Status"] == 3) {
+ // // Completed
+ // rrtServiceData.completedOrders.add(PrescriptionsOrder.fromJson(json));
+ // }
+ rrtServiceData.completedOrders.add(PrescriptionsOrder.fromJson(json));
}
return Future.error("404");
});
diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart
index a038aaf4..651165e4 100644
--- a/lib/models/Appointments/DoctorListResponse.dart
+++ b/lib/models/Appointments/DoctorListResponse.dart
@@ -21,6 +21,7 @@ class DoctorList {
bool isDoctorAllowVedioCall;
bool isDoctorDummy;
bool isLiveCare;
+ bool isLiveCareClinic;
bool isDoctorHasPrePostImages;
String latitude;
String longitude;
@@ -63,6 +64,7 @@ class DoctorList {
this.isDoctorAllowVedioCall,
this.isDoctorDummy,
this.isLiveCare,
+ this.isLiveCareClinic,
this.isDoctorHasPrePostImages,
this.latitude,
this.longitude,
@@ -105,6 +107,7 @@ class DoctorList {
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isDoctorDummy = json['IsDoctorDummy'];
isLiveCare = json['IsLiveCare'];
+ isLiveCareClinic = json['IsLiveCareClinic'];
isDoctorHasPrePostImages = json['IsDoctorHasPrePostImages'];
latitude = json['Latitude'];
longitude = json['Longitude'];
@@ -150,6 +153,7 @@ class DoctorList {
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
data['IsDoctorDummy'] = this.isDoctorDummy;
data['IsLiveCare'] = this.isLiveCare;
+ data['IsLiveCareClinic'] = this.isLiveCareClinic;
data['IsDoctorHasPrePostImages'] = this.isDoctorHasPrePostImages;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart
index 8b53119b..5c0c5d3f 100644
--- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart
+++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart
@@ -50,7 +50,7 @@ class ConfirmDialog extends StatelessWidget {
],
),
Text(
- "Request has been sent successfully. You will be contacted soon.",
+ TranslationBase.of(context).RRTRequestSuccess,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 14,
@@ -60,7 +60,7 @@ class ConfirmDialog extends StatelessWidget {
),
mHeight(20),
Text(
- "Request ID",
+ TranslationBase.of(context).reqId,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart
index d4e2ee02..39650f3b 100644
--- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart
+++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart
@@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
+import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
@@ -22,7 +23,7 @@ class NewCMCStepOnePage extends StatefulWidget {
final double latitude;
final double longitude;
- const NewCMCStepOnePage({Key key, this.cMCInsertPresOrderRequestModel, this.model, this.changePageViewIndex,this.latitude,this.longitude}) : super(key: key);
+ const NewCMCStepOnePage({Key key, this.cMCInsertPresOrderRequestModel, this.model, this.changePageViewIndex, this.latitude, this.longitude}) : super(key: key);
@override
_NewCMCStepOnePageState createState() => _NewCMCStepOnePageState();
@@ -41,160 +42,152 @@ class _NewCMCStepOnePageState extends State {
return AppScaffold(
isShowAppBar: false,
baseViewModel: widget.model,
- body: SingleChildScrollView(
- physics: ScrollPhysics(),
- child: Container(
- margin: EdgeInsets.only(left: 12, right: 12),
- child: Center(
- child: Column(
- children: [
- ListView.separated(
- physics: NeverScrollableScrollPhysics(),
- shrinkWrap: true,
- itemBuilder: (context, index) {
- return Row(
- children: [
- Radio(
- value: widget.model.cmcAllServicesList[index].serviceID,
- activeColor: Colors.red[800],
- onChanged: (newValue) async {
- PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
- price: widget.model.cmcAllServicesList[index].price,
- serviceID: widget.model.cmcAllServicesList[index].serviceID.toString(),
- selectedServiceName: widget.model.cmcAllServicesList[index].description,
- selectedServiceNameAR: widget.model.cmcAllServicesList[index].descriptionN,
- recordID: 1,
- totalPrice: widget.model.cmcAllServicesList[index].totalPrice,
- vAT: widget.model.cmcAllServicesList[index].vAT);
- setState(() {
- widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList];
- });
- CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: newValue);
- await widget.model.getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel);
- },
- groupValue: widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length > 0
- ? int.parse(widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList[0].serviceID)
- : 1),
- Expanded(
- child: Padding(
- padding: const EdgeInsets.only(
- left: 10,
- right: 10,
- top: 20,
- bottom: 20,
- ),
- child: Text(
- projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].descriptionN : widget.model.cmcAllServicesList[index].description,
- style: TextStyle(
- fontSize: 14,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
+ body: Column(
+ children: [
+ Expanded(
+ child: SingleChildScrollView(
+ physics: BouncingScrollPhysics(),
+ padding: EdgeInsets.all(21),
+ child: Column(
+ children: [
+ ListView.separated(
+ physics: NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemBuilder: (context, index) {
+ return Row(
+ children: [
+ Radio(
+ value: widget.model.cmcAllServicesList[index].serviceID,
+ activeColor: Colors.red[800],
+ onChanged: (newValue) async {
+ PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
+ price: widget.model.cmcAllServicesList[index].price,
+ serviceID: widget.model.cmcAllServicesList[index].serviceID.toString(),
+ selectedServiceName: widget.model.cmcAllServicesList[index].description,
+ selectedServiceNameAR: widget.model.cmcAllServicesList[index].descriptionN,
+ recordID: 1,
+ totalPrice: widget.model.cmcAllServicesList[index].totalPrice,
+ vAT: widget.model.cmcAllServicesList[index].vAT);
+ setState(() {
+ widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList];
+ });
+ CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: newValue);
+ await widget.model.getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel);
+ },
+ groupValue: widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length > 0
+ ? int.parse(widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList[0].serviceID)
+ : 1),
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.only(
+ left: 10,
+ right: 10,
+ top: 20,
+ bottom: 20,
),
- ),
- ),
- ),
- ],
- );
- },
- separatorBuilder: (context, index) {
- return mDivider(Colors.grey);
- },
- itemCount: widget.model.cmcAllServicesList.length),
- Card(
- shape: cardRadius(12),
- elevation: 4,
- child: Container(
- width: double.infinity,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Padding(
- padding: const EdgeInsets.only(left: 12,right: 12,top: 12),
- child: Text(
- TranslationBase.of(context).coveredService,
- style: TextStyle(
- fontSize: 14,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
- ),
- ),
- ),
- ListView.separated(
- itemBuilder: (context, index) {
- return Padding(
- padding: const EdgeInsets.all(12.0),
- child: Text(
- widget.model.checkupItems[index].itemName,
- style: TextStyle(
- fontSize: 12,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
+ child: Text(
+ projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].descriptionN : widget.model.cmcAllServicesList[index].description,
+ style: TextStyle(
+ fontSize: 14,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.45,
+ ),
),
),
- );
- },
- separatorBuilder: (context, index) {
- return mDivider(Colors.grey);
- },
- physics: NeverScrollableScrollPhysics(),
- shrinkWrap: true,
- itemCount: widget.model.checkupItems.length,
- ),
- ],
- ),
- ),
- ),
- mHeight(MediaQuery.of(context).size.height * 0.12),
- ],
+ ),
+ ],
+ );
+ },
+ separatorBuilder: (context, index) {
+ return mDivider(Colors.grey);
+ },
+ itemCount: widget.model.cmcAllServicesList.length),
+ Image.asset(projectViewModel.isArabic?"assets/images/cc_ar.png":"assets/images/cc_en.png",width: double.infinity,),
+ // Card(
+ // shape: cardRadius(12),
+ // elevation: 4,
+ // child: Container(
+ // width: double.infinity,
+ // child: Column(
+ // crossAxisAlignment: CrossAxisAlignment.start,
+ // children: [
+ // Padding(
+ // padding: const EdgeInsets.only(left: 12, right: 12, top: 12),
+ // child: Text(
+ // TranslationBase.of(context).coveredService,
+ // style: TextStyle(
+ // fontSize: 14,
+ // fontWeight: FontWeight.w600,
+ // letterSpacing: -0.45,
+ // ),
+ // ),
+ // ),
+ // ListView.separated(
+ // itemBuilder: (context, index) {
+ // return Padding(
+ // padding: const EdgeInsets.all(12.0),
+ // child: Text(
+ // widget.model.checkupItems[index].itemName,
+ // style: TextStyle(
+ // fontSize: 12,
+ // fontWeight: FontWeight.w600,
+ // letterSpacing: -0.45,
+ // ),
+ // ),
+ // );
+ // },
+ // separatorBuilder: (context, index) {
+ // return mDivider(Colors.grey);
+ // },
+ // physics: NeverScrollableScrollPhysics(),
+ // shrinkWrap: true,
+ // itemCount: widget.model.checkupItems.length,
+ // ),
+ // ],
+ // ),
+ // ),
+ // ),
+ ],
+ ),
),
),
- ),
- ),
- bottomSheet: Container(
- height: MediaQuery.of(context).size.height * 0.10,
- width: double.infinity,
- color: CustomColors.appBackgroudGreyColor,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Container(
- width: MediaQuery.of(context).size.width * 0.9,
- child: SecondaryButton(
- label: TranslationBase.of(context).next,
- textColor: Theme.of(context).backgroundColor,
- color: CustomColors.accentColor,
- onTap: () async {
- if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length != 0 || widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList == null) {
- int index = widget.model.cmcAllServicesList.length;
- PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
- price: widget.model.cmcAllServicesList[index - 1].price,
- serviceID: widget.model.cmcAllServicesList[index - 1].serviceID.toString(),
- selectedServiceName: widget.model.cmcAllServicesList[index - 1].description,
- selectedServiceNameAR: widget.model.cmcAllServicesList[index - 1].descriptionN,
- recordID: 1,
- totalPrice: widget.model.cmcAllServicesList[index - 1].totalPrice,
- vAT: widget.model.cmcAllServicesList[index - 1].vAT);
+ Container(
+ color: Colors.white,
+ padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
+ child: DefaultButton(
+ TranslationBase.of(context).next,
+ () async {
+ if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length != 0 || widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList == null) {
+ int index = widget.model.cmcAllServicesList.length;
+ PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
+ price: widget.model.cmcAllServicesList[index - 1].price,
+ serviceID: widget.model.cmcAllServicesList[index - 1].serviceID.toString(),
+ selectedServiceName: widget.model.cmcAllServicesList[index - 1].description,
+ selectedServiceNameAR: widget.model.cmcAllServicesList[index - 1].descriptionN,
+ recordID: 1,
+ totalPrice: widget.model.cmcAllServicesList[index - 1].totalPrice,
+ vAT: widget.model.cmcAllServicesList[index - 1].vAT);
- widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList];
- await widget.model.getCustomerInfo();
- if (widget.model.state == ViewState.ErrorLocal) {
- Utils.showErrorToast();
- } else {
- navigateTo(context,NewCMCStepTowPage(
- longitude: widget.longitude,
- latitude: widget.latitude,
- cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel,
- model: widget.model,
- ));
+ widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList];
+ await widget.model.getCustomerInfo();
+ if (widget.model.state == ViewState.ErrorLocal) {
+ Utils.showErrorToast();
+ } else {
+ navigateTo(
+ context,
+ NewCMCStepTowPage(
+ longitude: widget.longitude,
+ latitude: widget.latitude,
+ cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel,
+ model: widget.model,
+ ));
// widget.changePageViewIndex(1);
- }
}
- },
- ),
+ }
+ },
),
- ],
- ),
+ ),
+ ],
),
);
}
diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart
index 652f9b48..42212c40 100644
--- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart
+++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart
@@ -2,12 +2,14 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
import 'NewCMC/new_cmc_page.dart';
import 'orders_log_details_page.dart';
@@ -34,6 +36,7 @@ class _CMCPageState extends State with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
+ ProjectViewModel projectViewModel = Provider.of(context);
return BaseView(
onModelReady: (model) async {
await model.getCmcAllPresOrders();
@@ -47,61 +50,35 @@ class _CMCPageState extends State with SingleTickerProviderStateMixin {
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
showNewAppBar: true,
showNewAppBarTitle: true,
- backgroundColor: CustomColors.appBackgroudGreyColor,
+ backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column(
children: [
- Container(
- height: 60.0,
- width: double.infinity,
- child: Center(
- child: TabBar(
- isScrollable: false,
- controller: _tabController,
- indicatorWeight: 3.0,
- indicatorSize: TabBarIndicatorSize.tab,
- indicatorColor: CustomColors.accentColor,
- labelColor: Colors.black,
- labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
- unselectedLabelColor: Colors.grey[800],
- tabs: [
- Center(
- child: Text(
- TranslationBase.of(context).comprehensiveMedicalCheckup,
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 13,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.34,
- ),
- ),
- ),
- Center(
- child: Text(
- TranslationBase.of(context).orderLog,
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 13,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.34,
- ),
- ),
- ),
- ],
- ),
+ TabBar(
+ controller: _tabController,
+ indicatorWeight: 3.0,
+ indicatorSize: TabBarIndicatorSize.tab,
+ labelColor: Color(0xff2B353E),
+ unselectedLabelColor: Color(0xff575757),
+ labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
+ labelStyle: TextStyle(
+ fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
+ fontSize: 16,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.48,
),
+ unselectedLabelStyle: TextStyle(
+ fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
+ fontSize: 16,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.48,
+ ),
+ tabs: [Text(TranslationBase.of(context).cmcHeading), Text(TranslationBase.of(context).orderLog)],
),
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
- children: [
- NewCMCPage(
- model: model,
- ),
- OrdersLogDetailsPage(
- model: model,
- )
- ],
+ children: [NewCMCPage(model: model), OrdersLogDetailsPage(model: model)],
),
)
],
diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart
index 2cbfcd42..c88687c2 100644
--- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart
+++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart
@@ -7,7 +7,10 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
+import 'package:diplomaticquarterapp/uitl/utils_new.dart';
+import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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:provider/provider.dart';
@@ -25,234 +28,148 @@ class OrdersLogDetailsPage extends StatelessWidget {
void showConfirmMessage(CMCViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog(
- context: context,
- child: ConfirmCancelOrderDialog(
- model: model,
- onTap: () async {
- UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
- await model.updateCmcPresOrder(updatePresOrderRequestModel);
- if (model.state == ViewState.ErrorLocal) {
- Utils.showErrorToast(model.error);
- } else {
- AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
- await model.getCmcAllPresOrders();
- }
- },
- ));
+ context: context,
+ child: ConfirmCancelOrderDialog(
+ model: model,
+ onTap: () async {
+ UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
+ await model.updateCmcPresOrder(updatePresOrderRequestModel);
+ if (model.state == ViewState.ErrorLocal) {
+ Utils.showErrorToast(model.error);
+ } else {
+ AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
+ await model.getCmcAllPresOrders();
+ }
+ },
+ ),
+ );
}
return AppScaffold(
isShowAppBar: false,
baseViewModel: model,
- body: SingleChildScrollView(
- physics: ScrollPhysics(),
- child: Container(
- margin: EdgeInsets.all(12),
- child: Center(
- child: FractionallySizedBox(
- widthFactor: 0.94,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: model.cmcAllPresOrders.map((order) {
- return Container(
- width: double.infinity,
- margin: EdgeInsets.only(top: 12),
- clipBehavior: Clip.antiAlias,
- decoration: BoxDecoration(border: Border.all(color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12), color: Colors.white),
- child: Column(
+ body: ListView.separated(
+ padding: EdgeInsets.all(21),
+ physics: BouncingScrollPhysics(),
+ itemBuilder: (context, index) {
+ GetHHCAllPresOrdersResponseModel order = model.cmcAllPresOrders[index];
+
+ int status = order.status;
+ String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description;
+ Color _color;
+ if (status == 1) {
+ //pending
+ _color = Color(0xffCC9B14);
+ } else if (status == 2) {
+ //processing
+ _color = Color(0xff2E303A);
+ } else if (status == 3) {
+ //completed
+ _color = Color(0xff359846);
+ } else if (status == 4) {
+ //cancel // Rejected
+ _color = Color(0xffD02127);
+ }
+ return Container(
+ decoration: BoxDecoration(
+ color: _color,
+ borderRadius: BorderRadius.all(
+ Radius.circular(10.0),
+ ),
+ boxShadow: [
+ BoxShadow(
+ color: Color(0xff000000).withOpacity(.05),
+ blurRadius: 27,
+ offset: Offset(0, -3),
+ ),
+ ],
+ ),
+ child: Container(
+ // decoration: containerColorRadiusLeft(Colors.white, 12),
+ margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
+ padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ border: Border.all(color: Colors.white, width: 1),
+ borderRadius: BorderRadius.only(
+ bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
+ topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
+ bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
+ topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
+ ),
+ ),
+ // clipBehavior: Clip.antiAlias,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Expanded(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ _statusDisp,
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
+ ),
+ SizedBox(height: 6),
+ Text(
+ '${TranslationBase.of(context).requestID}: ${order.iD}',
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
+ ),
+ Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- SizedBox(
- height: 6,
- ),
- Container(
- width: double.infinity,
- padding: EdgeInsets.only(left: 15, bottom: 15, top: 8, right: 15),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- color: Colors.grey,
- width: 1.0,
- ),
- ),
- // borderRadius: BorderRadius.circular(12),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- TranslationBase.of(context).requestID,
- style: TextStyle(
- fontSize: 13,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
- ),
- ),
- SizedBox(
- height: 4,
- ),
- Text(
- order.iD.toString(),
- style: TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
- ),
- ),
- ],
- ),
+ Text(
+ TranslationBase.of(context).serviceName + ": ",
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
- Container(
- width: double.infinity,
- padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- color: Colors.grey,
- width: 1.0,
- ),
- ),
- // borderRadius: BorderRadius.circular(12),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- TranslationBase.of(context).OrderStatus,
- style: TextStyle(
- fontSize: 13,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
- ),
- ),
- SizedBox(
- height: 4,
- ),
- Text(
- projectViewModel.isArabic ? order.descriptionN : order.description,
- style: TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
- ),
- ),
- ],
+ Expanded(
+ child: Text(
+ !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
+ style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
),
),
- Container(
- width: double.infinity,
- padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- color: Colors.grey,
- width: 1.0,
- ),
- ),
- // borderRadius: BorderRadius.circular(12),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- TranslationBase.of(context).pickupDate,
- style: TextStyle(
- fontSize: 13,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
- ),
- ),
- SizedBox(
- height: 4,
- ),
- Text(
- DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)),
- style: TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
- ),
- ),
- ],
- ),
+ ],
+ )
+ ],
+ ),
+ ),
+ Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Text(
+ DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic),
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
+ ),
+ SizedBox(height: 12),
+ if (order.status == 1 || order.status == 2)
+ InkWell(
+ onTap: () {
+ showConfirmMessage(model, order);
+ },
+ child: Container(
+ padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
+ decoration: BoxDecoration(
+ color: Color(0xffD02127),
+ border: Border.all(color: Colors.white, width: 1),
+ borderRadius: BorderRadius.circular(10),
),
- Container(
- width: double.infinity,
- clipBehavior: Clip.antiAlias,
- padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- color: (order.status == 1 || order.status == 2) ? Colors.grey : Colors.transparent,
- width: (order.status == 1 || order.status == 2) ? 1.0 : 0,
- ),
- ),
- // borderRadius: BorderRadius.circular(12),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- TranslationBase.of(context).orderLocation,
- style: TextStyle(
- fontSize: 13,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
- ),
- ),
- SizedBox(
- height: 4,
- ),
- Text(
- !projectViewModel.isArabic ? order.projectDescription.toString() : order.projectDescriptionN.toString(),
- style: TextStyle(
- fontSize: 13,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.45,
- ),
- ),
- ],
- ),
+ child: Text(
+ TranslationBase.of(context).cancel_nocaps,
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
- (order.status == 1 || order.status == 2)
- ? SizedBox(
- height: 12,
- )
- : Container(),
- if (order.status == 1 || order.status == 2)
- Center(
- child: Container(
- width: MediaQuery.of(context).size.width * 0.85,
- child: SecondaryButton(
- label: TranslationBase.of(context).cancel.toUpperCase(),
- onTap: () {
- showConfirmMessage(model, order);
- },
- color: Colors.red[800],
- disabled: false,
- textColor: Theme.of(context).backgroundColor),
- ),
- ),
- (order.status == 1 || order.status == 2)
- ? SizedBox(
- height: 12,
- )
- : SizedBox(
- height: 2,
- ),
- ],
+ ),
),
- );
- }).toList())
- ],
+ ],
+ ),
+ ],
+ ),
),
- ),
- ),
- ),
- ),
+ );
+ },
+ separatorBuilder: (context, index) => SizedBox(height: 12),
+ itemCount: model.cmcAllPresOrders.length),
);
}
}
diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart
index ffc0b065..b817afc1 100644
--- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart
+++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart
@@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
+import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
@@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
+import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@@ -42,106 +44,83 @@ class _NewHomeHealthCareStepOnePageState extends State Divider(
+ height: 1,
+ color: Color(0xffE5E5E5),
+ ),
+ itemCount: widget.model.hhcAllServicesList.length),
+ ),
+ Container(
+ color: Colors.white,
+ padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
+ child: DefaultButton(
+ TranslationBase.of(context).next,
+ (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal)
+ ? null
+ : () async {
+ widget.model.setState(ViewState.Busy);
+ await widget.model.getCustomerInfo();
+ if (widget.model.state == ViewState.ErrorLocal) {
+ Utils.showErrorToast();
+ } else {
+ Navigator.push(
+ context,
+ FadePage(
+ page: NewHomeHealthCareStepTowPage(
+ patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
+ model: widget.model,
),
- Divider(
- height: 1,
- color: Colors.grey,
- )
- ],
- ),
- );
- }).toList(),
- ),
- SizedBox(height: 70)
- ],
- ),
+ ),
+ );
+ }
+ },
+ textColor: (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal) ? Color(0xff000000) : Colors.white,
+ disabledColor: Color(0xffEAEAEA),
),
),
- ),
- ),
- bottomSheet: Container(
- width: MediaQuery.of(context).size.width,
- height: 70.0,
- color: Theme.of(context).scaffoldBackgroundColor,
- margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
- child: Button(
- onTap: () async {
- widget.model.setState(ViewState.Busy);
- await widget.model.getCustomerInfo();
- if (widget.model.state == ViewState.ErrorLocal) {
- Utils.showErrorToast();
- } else {
- Navigator.push(
- context,
- FadePage(
- page: NewHomeHealthCareStepTowPage(
- patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
- model: widget.model,
- ),
- ),
- );
- }
- },
- label: TranslationBase.of(context).next,
- backgroundColor: (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal) ? Colors.grey : Colors.red[900],
- disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal,
- loading: widget.model.state == ViewState.BusyLocal,
- ),
+ ],
),
);
}
diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart
index 33ef6a51..4b06d220 100644
--- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart
+++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart
@@ -22,6 +22,7 @@ class NewHomeHealthCarePage extends StatefulWidget {
NewHomeHealthCarePage({this.model});
final HomeHealthCareViewModel model;
+
@override
_NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState();
}
@@ -94,15 +95,6 @@ class _NewHomeHealthCarePageState extends State with Tick
height: MediaQuery.of(context).size.height * 0.8,
child: Column(
children: [
- // Container(
- // margin: EdgeInsets.only(
- // left: MediaQuery.of(context).size.width * 0.05,
- // right: MediaQuery.of(context).size.width * 0.05),
- // child: StepsWidget(
- // index: _currentIndex,
- // changeCurrentTab: _changeCurrentTab,
- // ),
- // ),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
@@ -190,25 +182,17 @@ class _NewHomeHealthCarePageState extends State with Tick
fontSize: 14,
),
mHeight(8),
- SecondaryButton(
- onTap: () {
- showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
- },
- label: TranslationBase.of(context).cancel,
- color: Colors.red[900],
- small: true,
- )
+ // SecondaryButton(
+ // onTap: () {
+ // showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
+ // },
+ // label: TranslationBase.of(context).cancel,
+ // color: Colors.red[900],
+ // small: true,
+ // )
],
),
],
- // )
- // ],
- // )
- // ],
- // ),
- // ],
- //))
- // ],
))),
))))
: NewHomeHealthCareStepOnePage(
diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart
index a5979ca2..1a4a9f4f 100644
--- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart
+++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart
@@ -2,12 +2,14 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
import 'NewHomeHealthCare/new_home_health_care_page.dart';
import 'orders_log_details_page.dart';
@@ -34,6 +36,7 @@ class _HomeHealthCarePageState extends State with SingleTick
@override
Widget build(BuildContext context) {
+ ProjectViewModel projectViewModel = Provider.of(context);
return BaseView(
onModelReady: (model) {
model.getHHCAllPresOrders();
@@ -45,67 +48,44 @@ class _HomeHealthCarePageState extends State with SingleTick
showNewAppBar: true,
showNewAppBarTitle: true,
imagesInfo: [ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png')],
- body: Scaffold(
- extendBodyBehindAppBar: true,
- appBar: PreferredSize(
- preferredSize: Size.fromHeight(65.0),
- child: Stack(
- children: [
- Center(
- child: Center(
- child: TabBar(
- isScrollable: true,
- controller: _tabController,
- indicatorWeight: 5.0,
- indicatorSize: TabBarIndicatorSize.tab,
- 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.37,
- child: Center(
- child: Texts(
- TranslationBase.of(context).homeHealthCare,
- color: Colors.black,
- ),
- ),
- ),
- Container(
- width: MediaQuery.of(context).size.width * 0.37,
- child: Center(
- child: Texts(
- TranslationBase.of(context).orderLog,
- color: Colors.black,
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- ],
+ body: Column(
+ children: [
+ TabBar(
+ controller: _tabController,
+ indicatorWeight: 3.0,
+ indicatorSize: TabBarIndicatorSize.tab,
+ labelColor: Color(0xff2B353E),
+ unselectedLabelColor: Color(0xff575757),
+ labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
+ labelStyle: TextStyle(
+ fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
+ fontSize: 16,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.48,
+ ),
+ unselectedLabelStyle: TextStyle(
+ fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
+ fontSize: 16,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.48,
+ ),
+ tabs: [Text(TranslationBase.of(context).homeHealthCare), Text(TranslationBase.of(context).orderLog)],
),
- ),
- body: Column(
- children: [
- Expanded(
- child: TabBarView(
- physics: BouncingScrollPhysics(),
- controller: _tabController,
- children: [
- NewHomeHealthCarePage(
- model: model,
- ),
- OrdersLogDetailsPage(
- model: model,
- )
- ],
- ),
- )
- ],
- ),
+ Expanded(
+ child: TabBarView(
+ physics: BouncingScrollPhysics(),
+ controller: _tabController,
+ children: [
+ NewHomeHealthCarePage(
+ model: model,
+ ),
+ OrdersLogDetailsPage(
+ model: model,
+ )
+ ],
+ ),
+ )
+ ],
),
),
);
diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart
index 8c09cd17..468ab225 100644
--- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart
+++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart
@@ -27,142 +27,150 @@ class OrdersLogDetailsPage extends StatelessWidget {
void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog(
- context: context,
- child: ConfirmCancelOrderDialog(
- model: model,
- onTap: () async {
- UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
- model.setState(ViewState.Busy);
- await model.updateHHCPresOrder(updatePresOrderRequestModel);
- if (model.state == ViewState.ErrorLocal) {
- Utils.showErrorToast(model.error);
- } else {
- AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
- await model.getHHCAllPresOrders();
- // await model.getHHCAllServices();
- }
- },
- ));
+ context: context,
+ child: ConfirmCancelOrderDialog(
+ model: model,
+ onTap: () async {
+ UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
+ model.setState(ViewState.Busy);
+ await model.updateHHCPresOrder(updatePresOrderRequestModel);
+ if (model.state == ViewState.ErrorLocal) {
+ Utils.showErrorToast(model.error);
+ } else {
+ AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
+ await model.getHHCAllPresOrders();
+ // await model.getHHCAllServices();
+ }
+ },
+ ),
+ );
}
return AppScaffold(
isShowAppBar: false,
baseViewModel: model,
- body: SingleChildScrollView(
- physics: ScrollPhysics(),
- child: Container(
- margin: EdgeInsets.all(10),
- child: Center(
- child: FractionallySizedBox(
- widthFactor: 0.94,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: model.hhcAllPresOrders.map((order) {
- return Container(
- // margin: EdgeInsets.all(10),
- child: Container(
- width: double.infinity,
- padding: EdgeInsets.only(left: 12, right: 12, top: 12),
- child: Card(
- shape: cardRadius(12),
- elevation: 2,
- margin: EdgeInsets.zero,
- color: order.status == 4
- ? Colors.red[900]
- : order.status == 3
- ? Colors.green[400]
- : Color(0xffcd9e1b),
- clipBehavior: Clip.antiAlias,
- child: Container(
- // decoration: containerColorRadiusLeft(Colors.white, 12),
- margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0),
- padding: EdgeInsets.all(12),
- // color: Colors.white,
- decoration: BoxDecoration(
- shape: BoxShape.rectangle,
- color: Colors.white,
- borderRadius: BorderRadius.only(
- topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
- topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
- bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
- bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
- ),
- ),
- // clipBehavior: Clip.antiAlias,
- child: Row(
- children: [
- Expanded(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Texts(
- TranslationBase.of(context).OrderStatus + ' ' + (projectViewModel.isArabic ? order.descriptionN : order.description),
- bold: false,
- fontSize: 12,
- color: order.status == 4
- ? Colors.red[900]
- : order.status == 3
- ? Colors.green[400]
- : Color(0xffcd9e1b),
- fontWeight: FontWeight.bold,
- ),
- Texts(
- TranslationBase.of(context).requestID + ' ' + order.iD.toString(),
- fontWeight: FontWeight.w600,
- fontSize: 18,
- ),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Texts(
- TranslationBase.of(context).orderLocation,
- bold: false,
- fontSize: 13,
- ),
- SizedBox(
- height: 4,
- ),
- Texts(
- !projectViewModel.isArabic ? order.nearestProjectDescription.toString() : order.nearestProjectDescriptionN.toString(),
- fontSize: 13,
- ),
- ],
- )
- ],
- )),
- Column(
- children: [
- Texts(
- DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)),
- fontSize: 14,
- ),
- SizedBox(height: 8),
- (order.status == 1 || order.status == 2)
- ? SecondaryButton(
- onTap: () {
- showConfirmMessage(model, order);
- },
- label: TranslationBase.of(context).cancel,
- color: Colors.red[900],
- small: true,
- )
- : SizedBox()
- ],
- ),
- ],
- ))),
- ));
- }).toList())
+ body: ListView.separated(
+ padding: EdgeInsets.all(21),
+ physics: BouncingScrollPhysics(),
+ itemBuilder: (context, index) {
+ GetHHCAllPresOrdersResponseModel order = model.hhcAllPresOrders[index];
+
+ int status = order.status;
+ String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description;
+ Color _color;
+ if (status == 1) {
+ //pending
+ _color = Color(0xffCC9B14);
+ } else if (status == 2) {
+ //processing
+ _color = Color(0xff2E303A);
+ } else if (status == 3) {
+ //completed
+ _color = Color(0xff359846);
+ } else if (status == 4) {
+ //cancel // Rejected
+ _color = Color(0xffD02127);
+ }
+ return Container(
+ decoration: BoxDecoration(
+ color: _color,
+ borderRadius: BorderRadius.all(
+ Radius.circular(10.0),
+ ),
+ boxShadow: [
+ BoxShadow(
+ color: Color(0xff000000).withOpacity(.05),
+ blurRadius: 27,
+ offset: Offset(0, -3),
+ ),
],
),
- ),
- ),
- ),
- ),
+ child: Container(
+ // decoration: containerColorRadiusLeft(Colors.white, 12),
+ margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
+ padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ border: Border.all(color: Colors.white, width: 1),
+ borderRadius: BorderRadius.only(
+ bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
+ topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
+ bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
+ topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
+ ),
+ ),
+ // clipBehavior: Clip.antiAlias,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Expanded(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ _statusDisp,
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
+ ),
+ SizedBox(height: 6),
+ Text(
+ '${TranslationBase.of(context).requestID}: ${order.iD}',
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
+ ),
+ Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ TranslationBase.of(context).serviceName + ": ",
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
+ ),
+ Expanded(
+ child: Text(
+ !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
+ style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
+ ),
+ ),
+ ],
+ )
+ ],
+ ),
+ ),
+ Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Text(
+ DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic),
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
+ ),
+ SizedBox(height: 12),
+ if (order.status == 1 || order.status == 2)
+ InkWell(
+ onTap: () {
+ showConfirmMessage(model, order);
+ },
+ child: Container(
+ padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
+ decoration: BoxDecoration(
+ color: Color(0xffD02127),
+ border: Border.all(color: Colors.white, width: 1),
+ borderRadius: BorderRadius.circular(10),
+ ),
+ child: Text(
+ TranslationBase.of(context).cancel_nocaps,
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ separatorBuilder: (context, index) => SizedBox(height: 12),
+ itemCount: model.hhcAllPresOrders.length),
);
}
}
diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart
index 387bd41a..d9499eeb 100644
--- a/lib/pages/BookAppointment/BookSuccess.dart
+++ b/lib/pages/BookAppointment/BookSuccess.dart
@@ -480,7 +480,11 @@ class _BookSuccessState extends State {
appo.clinicID = widget.patientShareResponse.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo;
- Navigator.push(context, FadePage(page: PaymentMethod())).then((value) {
+ Navigator.push(context, FadePage(page: PaymentMethod(
+ onSelectedMethod: (String metohd) {
+ setState(() {});
+ }
+ ))).then((value) {
if (value != null) {
openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
}
diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart
index f5b6de95..6d3a3afa 100644
--- a/lib/pages/BookAppointment/DoctorProfile.dart
+++ b/lib/pages/BookAppointment/DoctorProfile.dart
@@ -171,7 +171,7 @@ class _DoctorProfileState extends State with TickerProviderStateM
child: Text(
TranslationBase.of(context).availableAppo,
style: TextStyle(
- color: Colors.black,
+ color: widget.isLiveCareAppointment ? Colors.grey : Colors.black,
fontSize: 12,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
index 1dc66d5f..65c9443f 100644
--- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
+++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
@@ -358,6 +358,7 @@ class _DocAvailableAppointmentsState extends State wit
});
} else {
DocAvailableAppointments.areAppointmentsAvailable = false;
+ AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart
index c5e41abe..d3accfe1 100644
--- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart
+++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart
@@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
+import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
+import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@@ -15,7 +17,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
-import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@@ -66,7 +67,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat
ScrollController _scrollController;
- ProjectViewModel projectViewModel;
+ ToDoCountProviderModel toDoProvider;
@override
void initState() {
@@ -119,203 +120,211 @@ class _CovidTimeSlotsState extends State with TickerProviderStat
@override
Widget build(BuildContext context) {
- projectViewModel = Provider.of(context);
+ ProjectViewModel projectViewModel = Provider.of(context);
+ toDoProvider = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
- body: SingleChildScrollView(
- child: Container(
- margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- height: 150.0,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage("assets/images/new-design/covid-19-big-banner-bg.png"),
- fit: BoxFit.fill,
- ),
- color: Colors.white.withOpacity(0.3),
- borderRadius: BorderRadius.all(Radius.circular(10))),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
- child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 90.0, height: 90.0),
- ),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
- child: Text(TranslationBase.of(context).covidTest, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 24.0)),
- ),
- Container(
- margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 10.0),
- child: Text(TranslationBase.of(context).driveThru, style: TextStyle(color: Colors.white, fontSize: 24.0)),
- ),
- ],
- ),
- ],
- ),
- ),
- Container(
+ backgroundColor: CustomColors.appBackgroudGrey2Color,
+ body: Column(
+ children: [
+ Expanded(
+ child: SingleChildScrollView(
+ child: Container(
+ margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisSize: MainAxisSize.max,
children: [
- _buildTableCalendarWithBuilders(projectViewModel),
- Padding(
- padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
- child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
- ),
Container(
- height: 40,
- child: ListView.builder(
- controller: _scrollController,
- scrollDirection: Axis.horizontal,
- itemCount: dayEvents.length,
- itemBuilder: (context, index) {
- return Container(
- margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5),
- child: ButtonTheme(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(5.0),
- side: BorderSide(
- color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
- style: BorderStyle.solid, //Style of the border
- width: 1.5, //width of the border
- ),
- ),
- minWidth: MediaQuery.of(context).size.width * 0.18,
- child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
- );
- },
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ Text(
+ TranslationBase.of(context).selectAppo,
+ style: TextStyle(
+ color: Colors.black,
+ fontSize: 16.0,
+ letterSpacing: -0.64,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ Card(
+ shape: cardRadius(12),
+ child: _buildTableCalendarWithBuilders(projectViewModel),
+ ),
+ mHeight(12),
+ Text(
+ selectedDate,
+ style: TextStyle(
+ fontSize: 16.0,
+ fontWeight: FontWeight.bold,
+ letterSpacing: -0.64,
+ ),
+ ),
+ mHeight(8),
+ Container(
+ height: 40,
+ child: ListView.builder(
+ controller: _scrollController,
+ scrollDirection: Axis.horizontal,
+ itemCount: dayEvents.length,
+ itemBuilder: (context, index) {
+ return Container(
+ margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 0 : 5.0, left: index == 0 ? 0 : 5),
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(5.0),
+ side: BorderSide(
+ color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
+ style: BorderStyle.solid, //Style of the border
+ width: 1.5, //width of the border
+ ),
+ ),
+ minWidth: MediaQuery.of(context).size.width * 0.2,
+ child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
+ );
+ },
+ ),
+ ),
+ ],
),
),
+ SizedBox(
+ height: 100.0,
+ ),
],
),
),
- SizedBox(
- height: 10.0,
- ),
- if (CovidTimeSlots.areSlotsAvailable)
- Container(
- color: Colors.grey[100],
- margin: EdgeInsets.all(10.0),
- child: DefaultButton(
- TranslationBase.of(context).bookNow,
- () {
- bookCovidTestAppointment();
- },
+ ),
+ ),
+ Card(
+ elevation: 20,
+ margin: EdgeInsets.zero,
+ shape: cardRadius(0),
+ child: Container(
+ width: double.infinity,
+ padding: EdgeInsets.all(12),
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ minWidth: MediaQuery.of(context).size.width * 0.7,
+ height: 45.0,
+ child: RaisedButton(
+ color: CustomColors.green,
+ textColor: Colors.white,
+ disabledTextColor: Colors.white,
+ elevation: 0,
+ disabledColor: Colors.grey[500],
+ onPressed: () {
+ bookCovidTestAppointment();
+ },
+ child: Text(
+ TranslationBase.of(context).bookAppo,
+ style: TextStyle(
+ fontSize: 16.0,
+ letterSpacing: -0.64,
+ ),
),
),
- ],
- ),
- ),
+ ),
+ ),
+ )
+ ],
),
);
}
Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
- return Card(
- shape: cardRadius(12),
- margin: EdgeInsets.all(16),
- clipBehavior: Clip.antiAlias,
- child: Padding(
- padding: const EdgeInsets.only(bottom: 12),
- child: TableCalendar(
- locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US',
- calendarController: _calendarController,
- events: _events,
- initialCalendarFormat: CalendarFormat.month,
- startDay: DateTime.now(),
- formatAnimation: FormatAnimation.slide,
- startingDayOfWeek: StartingDayOfWeek.sunday,
- weekendDays: [DateTime.friday, DateTime.saturday],
- availableGestures: AvailableGestures.horizontalSwipe,
- availableCalendarFormats: const {
- CalendarFormat.month: '',
- CalendarFormat.week: '',
- },
- calendarStyle: CalendarStyle(
- outsideDaysVisible: false,
- weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
- holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
- ),
- daysOfWeekStyle: DaysOfWeekStyle(
- weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
- weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
- ),
- headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
- builders: CalendarBuilders(
- selectedDayBuilder: (context, date, _) {
- return FadeTransition(
- opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
- child: Container(
- margin: const EdgeInsets.all(4.0),
- padding: const EdgeInsets.only(top: 5.0, left: 5.0),
- color: Colors.transparent,
- width: 0,
- height: 0,
- child: Text(
- '${date.day}',
- style: TextStyle().copyWith(fontSize: 14.0),
- ),
- ),
- );
- },
- todayDayBuilder: (context, date, _) {
- return Container(
- decoration: BoxDecoration(
- shape: BoxShape.circle,
- color: _calendarController.isSelected(date)
- ? Colors.green[400]
- : _calendarController.isToday(date)
- ? Colors.transparent
- : Color(0xff76cfb7),
- ),
- width: 40.0,
- height: 40.0,
- child: Center(
- child: Text(
- '${date.day}',
- style: TextStyle().copyWith(
- color: Colors.white,
- fontSize: 14.0,
- ),
- ),
+ return TableCalendar(
+ locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US',
+ calendarController: _calendarController,
+ events: _events,
+ initialCalendarFormat: CalendarFormat.month,
+ startDay: DateTime.now(),
+ formatAnimation: FormatAnimation.slide,
+ startingDayOfWeek: StartingDayOfWeek.sunday,
+ weekendDays: [DateTime.friday, DateTime.saturday],
+ availableGestures: AvailableGestures.horizontalSwipe,
+ availableCalendarFormats: const {
+ CalendarFormat.month: '',
+ CalendarFormat.week: '',
+ },
+ calendarStyle: CalendarStyle(
+ outsideDaysVisible: false,
+ weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
+ holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
+ ),
+ daysOfWeekStyle: DaysOfWeekStyle(
+ weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
+ weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
+ ),
+ headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
+ builders: CalendarBuilders(
+ selectedDayBuilder: (context, date, _) {
+ return FadeTransition(
+ opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
+ child: Container(
+ margin: const EdgeInsets.all(4.0),
+ padding: const EdgeInsets.only(top: 5.0, left: 6.0),
+ color: Colors.transparent,
+ width: 0,
+ height: 0,
+ child: Text(
+ '${date.day}',
+ style: TextStyle().copyWith(fontSize: 14.0),
+ ),
+ ),
+ );
+ },
+ todayDayBuilder: (context, date, _) {
+ return Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: _calendarController.isSelected(date)
+ ? Colors.green[400]
+ : _calendarController.isToday(date)
+ ? Colors.transparent
+ : Color(0xff76cfb7),
+ ),
+ width: 40.0,
+ height: 40.0,
+ child: Center(
+ child: Text(
+ '${date.day}',
+ style: TextStyle().copyWith(
+ color: Colors.white,
+ fontSize: 14.0,
),
- );
- },
- markersBuilder: (context, date, events, holidays) {
- final children = [];
-
- if (events.isNotEmpty) {
- children.add(
- Positioned(
- right: 4,
- bottom: 4,
- child: _buildEventsMarker(date, events),
- ),
- );
- }
+ ),
+ ),
+ );
+ },
+ markersBuilder: (context, date, events, holidays) {
+ final children = [];
+
+ if (events.isNotEmpty) {
+ children.add(
+ Positioned(
+ right: 4,
+ bottom: 4,
+ child: _buildEventsMarker(date, events),
+ ),
+ );
+ }
- return children;
- },
- ),
- onDaySelected: (date, event, _) {
- _onDaySelected(date, event, projectViewModel);
- _animationController.forward(from: 0.0);
- },
- onVisibleDaysChanged: _onVisibleDaysChanged,
- onCalendarCreated: _onCalendarCreated,
- ),
+ return children;
+ },
),
+ onDaySelected: (date, event, _) {
+ _onDaySelected(date, event, projectViewModel);
+ _animationController.forward(from: 0.0);
+ },
+ onVisibleDaysChanged: _onVisibleDaysChanged,
+ onCalendarCreated: _onCalendarCreated,
);
}
@@ -353,7 +362,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat
_eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() {
CovidTimeSlots.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']));
- selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']), projectViewModel.isArabic ? "ar" : "en");
+ selectedDate = DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']));
selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots'];
});
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
@@ -363,12 +372,21 @@ class _CovidTimeSlotsState extends State with TickerProviderStat
Widget _buildEventsMarker(DateTime date, List events) {
return Container(
+ // decoration: BoxDecoration(
+ // shape: BoxShape.circle,
+ // color: _calendarController.isSelected(date)
+ // ? Colors.green[400]
+ // : _calendarController.isToday(date)
+ // ? Colors.brown[300]
+ // : Colors.blue[400],
+ // ),
+
decoration: containerColorRadiusBorderWidth(
_calendarController.isSelected(date)
? CustomColors.green
: _calendarController.isToday(date)
- ? CustomColors.green.withOpacity(0.5)
- : Colors.white,
+ ? CustomColors.green.withOpacity(0.5)
+ : Colors.white,
200,
_calendarController.isSelected(date) ? CustomColors.green : Colors.black,
2),
@@ -379,7 +397,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat
'${date.day}',
style: TextStyle().copyWith(
color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
- fontSize: 14.0,
+ fontSize: 13.0,
),
),
),
@@ -395,53 +413,35 @@ class _CovidTimeSlotsState extends State with TickerProviderStat
setState(() {
selectedButtonIndex = index;
CovidTimeSlots.selectedTime = dayEvents[index].isoTime;
+ print(CovidTimeSlots.selectedTime);
});
},
- child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)),
+ child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold)),
);
}
Widget getSelectedButton(int index) {
return RaisedButton(
- color: CustomColors.green,
- //Color of the border
+ color: CustomColors.green, //Color of the border
textColor: Colors.white,
- elevation: 0,
onPressed: () {
setState(() {
selectedButtonIndex = index;
CovidTimeSlots.selectedTime = dayEvents[index].isoTime;
+ print(CovidTimeSlots.selectedTime);
});
},
- child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)),
+ child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold)),
);
}
bookCovidTestAppointment() {
- var messageEn = "This Appointment is being booked for patient " +
- projectViewModel.user.firstName +
- " " +
- projectViewModel.user.lastName +
- ", Having file number " +
- projectViewModel.user.patientID.toString() +
- ". Please confirm!";
- var messageAr =
- "يتم حجز هذا الموعد المراجع " + projectViewModel.user.firstName + " " + projectViewModel.user.lastName + ", وجود رقم الملف " + projectViewModel.user.patientID.toString() + ". يرجى تأكيد!";
- ConfirmDialog dialog = new ConfirmDialog(
- context: context,
- confirmMessage: projectViewModel.isArabic ? messageAr : messageEn,
- okText: TranslationBase.of(context).confirm,
- cancelText: TranslationBase.of(context).cancel_nocaps,
- okFunction: () {
- GifLoaderDialogUtils.showMyDialog(context);
- DoctorList docObject = new DoctorList();
- docObject.doctorID = widget.selectedDoctorID;
- docObject.clinicID = widget.selectedClinicID;
- docObject.projectID = widget.projectID;
- insertAppointmentCovidTest(context, docObject);
- },
- cancelFunction: () => {});
- dialog.showAlertDialog(context);
+ GifLoaderDialogUtils.showMyDialog(context);
+ DoctorList docObject = new DoctorList();
+ docObject.doctorID = widget.selectedDoctorID;
+ docObject.clinicID = widget.selectedClinicID;
+ docObject.projectID = widget.projectID;
+ insertAppointmentCovidTest(context, docObject);
}
insertAppointmentCovidTest(context, DoctorList docObject) {
@@ -452,6 +452,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
+ getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
} else {
GifLoaderDialogUtils.hideDialog(context);
@@ -483,13 +484,28 @@ class _CovidTimeSlotsState extends State with TickerProviderStat
});
}
+ getToDoCount() {
+ toDoProvider.setState(0, true);
+ ClinicListService service = new ClinicListService();
+ service.getActiveAppointmentNo(context).then((res) {
+ print(res['AppointmentActiveNumber']);
+ if (res['MessageStatus'] == 1) {
+ toDoProvider.setState(res['AppointmentActiveNumber'], true);
+ } else {}
+ }).catchError((err) {
+ print(err);
+ });
+ }
+
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) {
+ // Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointmentCovidTest(context, docObject);
+ // });
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@@ -522,26 +538,24 @@ class _CovidTimeSlotsState extends State with TickerProviderStat
}
getCovidFreeSlots(BuildContext context, int projectID) {
- CovidTimeSlots.areSlotsAvailable = false;
CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context);
service.getCovidFreeSlots(context, projectID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['COVID19_FreeTimeSlots'].length != 0) {
- CovidTimeSlots.areSlotsAvailable = true;
freeSlotsResponse = res['COVID19_FreeTimeSlots'];
_getJSONSlots().then((value) => {
- setState(() => {widget.selectedClinicID = freeSlotsResponse[0]['ClinicID'], widget.selectedDoctorID = freeSlotsResponse[0]['DoctorID'], _events.clear(), _events = value})
- });
- } else {
- CovidTimeSlots.areSlotsAvailable = false;
- }
+ setState(() => {widget.selectedClinicID = freeSlotsResponse[0]['ClinicID'], widget.selectedDoctorID = freeSlotsResponse[0]['DoctorID'], _events.clear(), _events = value})
+ });
+ } else {}
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
+ GifLoaderDialogUtils.hideDialog(context);
+ AppToast.showErrorToast(message: err.toString());
print(err);
});
}
diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart
index 050331cf..458d9ec2 100644
--- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart
+++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart
@@ -5,10 +5,11 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoRespo
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
+import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
-import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
+import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
@@ -29,7 +30,6 @@ class CovidDirveThruQuestions extends StatefulWidget {
class CovidDirveThruQuestionsState extends State {
List qa;
- ProjectViewModel projectViewModel;
@override
void initState() {
@@ -37,91 +37,212 @@ class CovidDirveThruQuestionsState extends State {
qa = getQuestionsFromJson();
}
+ TranslationBase localize;
+ ProjectViewModel projectViewModel;
+
@override
Widget build(BuildContext context) {
+ localize = TranslationBase.of(context);
+ var isArabic = localize.isArabic();
projectViewModel = Provider.of(context);
- var isArabic = projectViewModel.isArabic;
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
+ backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Container(
- width: MediaQuery.of(context).size.width * 0.9,
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(15.0),
- ),
- margin: EdgeInsets.fromLTRB(18.0, 10.0, 18.0, 10.0),
- padding: EdgeInsets.fromLTRB(8.0, 10.0, 8.0, 10.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(TranslationBase.of(context).covidBookAppo, style: TextStyle(fontSize: 18, letterSpacing: 1, fontWeight: FontWeight.bold)),
- Text(TranslationBase.of(context).patientName.toString() + ": " + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, style: TextStyle(fontSize: 14, letterSpacing: 1)),
- Text(TranslationBase.of(context).fileNo.toString() + ": " + projectViewModel.user.patientID.toString(), style: TextStyle(fontSize: 14, letterSpacing: 1)),
- ],
- ),
- ),
- Padding(
- padding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
- child: Text(TranslationBase.of(context).covidQuestionnaire, style: TextStyle(fontSize: 17, letterSpacing: 1, fontWeight: FontWeight.bold)),
- ),
Expanded(
- child: ListView.separated(
- padding: EdgeInsets.symmetric(horizontal: 20),
- itemCount: qa.length,
- itemBuilder: (ctx, idx) {
- var obj = qa[idx];
- var qtext = isArabic ? obj["questionAR"] : obj["questionEN"];
- return Padding(
- padding: const EdgeInsets.symmetric(vertical: 10),
+ child: SingleChildScrollView(
+ child: Padding(
+ padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(qtext, style: TextStyle(fontSize: 15, letterSpacing: 1.5)),
- Row(
- children: [
- Radio(
- value: 1,
- groupValue: obj["ans"],
- onChanged: (newValue) {
- setState(() {
- obj["ans"] = newValue;
- });
- }),
- Text(TranslationBase.of(context).yes),
- ],
+ Container(
+ width: double.infinity,
+ child: Card(
+ shape: cardRadius(12),
+ margin: EdgeInsets.zero,
+ child: Padding(
+ padding: const EdgeInsets.all(12.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ TranslationBase.of(context).covidBookAppo,
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 16,
+ letterSpacing: -0.64,
+ ),
+ ),
+ mHeight(6),
+ Row(
+ children: [
+ Text(
+ TranslationBase.of(context).patientName + ":",
+ style: TextStyle(
+ fontWeight: FontWeight.w600,
+ fontSize: 10,
+ letterSpacing: -0.6,
+ color: CustomColors.grey,
+ ),
+ ),
+ mWidth(3),
+ Text(
+ projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
+ style: TextStyle(
+ fontWeight: FontWeight.w600,
+ fontSize: 12,
+ letterSpacing: -0.48,
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Text(
+ TranslationBase.of(context).fileNo + ":",
+ style: TextStyle(
+ fontWeight: FontWeight.w600,
+ fontSize: 10,
+ letterSpacing: -0.6,
+ color: CustomColors.grey,
+ ),
+ ),
+ mWidth(3),
+ Text(
+ projectViewModel.user.patientIdentificationNo,
+ style: TextStyle(
+ fontWeight: FontWeight.w600,
+ fontSize: 12,
+ letterSpacing: -0.48,
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ mHeight(12),
+ Text(
+ TranslationBase.of(context).covidQuestionnaire,
+ style: TextStyle(
+ fontSize: 16,
+ letterSpacing: -0.64,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ mHeight(12),
+ ListView.separated(
+ itemCount: qa.length,
+ physics: NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemBuilder: (ctx, idx) {
+ var obj = qa[idx];
+ var qtext = isArabic ? obj["questionAR"] : obj["questionEN"];
+
+ return Padding(
+ padding: const EdgeInsets.symmetric(vertical: 10),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ qtext,
+ style: TextStyle(
+ fontSize: 12,
+ letterSpacing: -0.48,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ Row(
+ children: [
+ Expanded(
+ child: Row(
+ children: [
+ Radio(
+ value: 1,
+ groupValue: obj["ans"],
+ onChanged: (newValue) {
+ setState(() {
+ obj["ans"] = newValue;
+ });
+ }),
+ Text(
+ localize.yes,
+ style: TextStyle(
+ fontSize: 12,
+ letterSpacing: -0.48,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ ],
+ ),
+ ),
+ Expanded(
+ child: Row(
+ children: [
+ Radio(
+ value: 0,
+ groupValue: obj["ans"],
+ onChanged: (newValue) {
+ setState(() {
+ obj["ans"] = newValue;
+ });
+ }),
+ Text(
+ localize.no,
+ style: TextStyle(
+ fontSize: 12,
+ letterSpacing: -0.48,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ ],
+ ),
+ )
+ ],
+ ),
+ ],
+ ),
+ );
+ },
+ separatorBuilder: (ctx, idx) => Container(),
),
- Row(
- children: [
- Radio(
- value: 0,
- groupValue: obj["ans"],
- onChanged: (newValue) {
- setState(() {
- obj["ans"] = newValue;
- });
- }),
- Text(TranslationBase.of(context).no),
- ],
- )
],
),
- );
- },
- separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)),
- )),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
- child: FractionallySizedBox(
- widthFactor: 1,
- child: DefaultButton(TranslationBase.of(context).next, () {
- next();
- }),
+ ),
+ ),
+ ),
+ Card(
+ margin: EdgeInsets.zero,
+ elevation: 20,
+ child: Container(
+ padding: EdgeInsets.all(12),
+ child: FractionallySizedBox(
+ widthFactor: 1,
+ child: MaterialButton(
+ height: 50,
+ elevation: 0,
+ color: CustomColors.accentColor,
+ disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25),
+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
+ child: Text(
+ localize.next,
+ style: TextStyle(
+ fontSize: 16.0,
+ fontWeight: FontWeight.bold,
+ letterSpacing: -0.44,
+ color: Colors.white,
+ ),
+ ),
+ onPressed: next,
+ ),
+ ),
),
),
],
@@ -139,7 +260,7 @@ class CovidDirveThruQuestionsState extends State {
getPaymentInfo(context, widget.projectId);
}
else
- AppToast.showErrorToast(message: TranslationBase.of(context).pleaseSelectAllQuestionToContinue);
+ AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue);
}
openPassportUpdatePage() {
diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart
index 8f38290e..b033e1f4 100644
--- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart
+++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart
@@ -67,7 +67,7 @@ class _CovidDrivethruLocationState extends State {
isShowDecPage: true,
showNewAppBarTitle: true,
showNewAppBar: true,
- backgroundColor: CustomColors.appBackgroudGreyColor,
+ backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column(
children: [
Expanded(
@@ -113,7 +113,7 @@ class _CovidDrivethruLocationState extends State {
),
),
Container(
- height: 18,
+ height: 20,
child: DropdownButtonHideUnderline(
child: DropdownButton(
onTap: () {
@@ -185,10 +185,13 @@ class _CovidDrivethruLocationState extends State {
padding: const EdgeInsets.only(left: 12, right: 12, top: 6, bottom: 6),
child: Row(
children: [
- SvgPicture.asset(
- "assets/images/new/blood_pressure.svg",
- width: 18,
- height: 18,
+ Padding(
+ padding: const EdgeInsets.all(3.0),
+ child: SvgPicture.asset(
+ "assets/images/new/direction.svg",
+ width: 13,
+ height: 13,
+ ),
),
mWidth(6),
Text(
@@ -218,33 +221,38 @@ class _CovidDrivethruLocationState extends State {
),
),
),
- Container(
- width: double.infinity,
- padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
- child: ButtonTheme(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
- ),
- minWidth: MediaQuery.of(context).size.width * 0.7,
- height: 45.0,
- child: RaisedButton(
- color: CustomColors.accentColor,
- textColor: Colors.white,
- disabledTextColor: Colors.white,
- disabledColor: CustomColors.accentColor,
- onPressed: () {
- next();
- },
- child: Text(
- TranslationBase.of(context).next,
- style: TextStyle(
- fontSize: 16.0,
- fontWeight: FontWeight.bold,
- letterSpacing: -0.44,
+ Card(
+ elevation: 20,
+ margin: EdgeInsets.zero,
+ child: Container(
+ width: double.infinity,
+ padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ minWidth: MediaQuery.of(context).size.width * 0.7,
+ height: 45.0,
+ child: RaisedButton(
+ color: CustomColors.accentColor,
+ textColor: Colors.white,
+ disabledTextColor: Colors.white,
+ disabledColor: CustomColors.accentColor,
+ elevation: 0,
+ onPressed: () {
+ next();
+ },
+ child: Text(
+ TranslationBase.of(context).next,
+ style: TextStyle(
+ fontSize: 16.0,
+ fontWeight: FontWeight.bold,
+ letterSpacing: -0.44,
+ ),
),
),
- ),
- )),
+ )),
+ ),
],
),
);
@@ -308,11 +316,8 @@ class _CovidDrivethruLocationState extends State {
CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context);
- CovidTestProceduresResponse covidTestProceduresResponse = new CovidTestProceduresResponse();
-
service.getCovidTestProceduresList(context).then((res) {
if (res['MessageStatus'] == 1) {
- print(res);
setState(() {
res['COVID19_TestProceduresList'].forEach((v) {
proceduresList.add(new CovidTestProceduresResponse.fromJson(v));
diff --git a/lib/pages/Covid-DriveThru/covid-payment-alert.dart b/lib/pages/Covid-DriveThru/covid-payment-alert.dart
index b676aa42..9d2ac0a5 100644
--- a/lib/pages/Covid-DriveThru/covid-payment-alert.dart
+++ b/lib/pages/Covid-DriveThru/covid-payment-alert.dart
@@ -3,10 +3,11 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
+import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
-import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
+import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@@ -30,215 +31,135 @@ class _CovidPaymentAlertState extends State {
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
- showNewAppBar: true,
showNewAppBarTitle: true,
- body: SingleChildScrollView(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- height: 180.0,
- color: new Color(0xFFc5272d),
- child: Row(
+ showNewAppBar: true,
+ backgroundColor: CustomColors.appBackgroudGrey2Color,
+ body: Column(
+ children: [
+ Expanded(
+ child: SingleChildScrollView(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
- margin: EdgeInsets.only(left: 50.0),
- child: SvgPicture.asset(
- 'assets/images/new-design/alert_icon.svg',
- width: 80.0,
- height: 80.0),
- ),
- Container(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
+ color: new Color(0xFFc5272d),
+ padding: EdgeInsets.all(20),
+ child: Row(
children: [
- Container(
- margin: EdgeInsets.only(left: 30.0, right: 20.0),
- child: Text(TranslationBase.of(context).covidAlert,
- style: TextStyle(
- color: Colors.white,
- fontWeight: FontWeight.bold,
- fontSize: 24.0)),
+ Icon(
+ Icons.warning_outlined,
+ color: Colors.white,
),
- Container(
- width: MediaQuery.of(context).size.width * 0.55,
- margin: EdgeInsets.only(
- left: 30.0, right: 20.0, top: 5.0),
+ mWidth(12),
+ Expanded(
child: Text(
- TranslationBase.of(context).covidAlertHeader,
- // "Pay With-in 15 mins to confirm the appointment",
- overflow: TextOverflow.clip,
- style: TextStyle(
- color: Colors.white, fontSize: 20.0)),
- ),
+ TranslationBase.of(context).covidAlertHeader,
+ style: TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.w600,
+ fontSize: 16.0,
+ letterSpacing: -0.64,
+ ),
+ ),
+ )
],
),
),
- ],
- ),
- ),
- Container(
- margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 15.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- alignment: Alignment.center,
- child: Text(TranslationBase.of(context).covidAlertMins,
- overflow: TextOverflow.clip,
- style: TextStyle(
- color: new Color(0xFFc5272d),
- fontSize: 24.0,
- fontWeight: FontWeight.bold)),
- ),
- Container(
- alignment: Alignment.center,
- margin: EdgeInsets.only(top: 5.0),
- child: Text(
- TranslationBase.of(context).covidAlertInfo,
- textAlign: TextAlign.center,
- style: TextStyle(
- color: Colors.grey[700],
- fontSize: 18.0,
- letterSpacing: 0.8)),
- ),
Container(
- margin: EdgeInsets.only(
- top: 20.0, bottom: 10.0, left: 0.0, right: 20.0),
- child: Text(TranslationBase.of(context).appoInfo,
- style: TextStyle(
- fontSize: 18.0,
- color: Colors.grey[700],
- fontWeight: FontWeight.bold)),
- ),
- Container(
- margin: EdgeInsets.only(left: 0.0, bottom: 20.0),
- width: MediaQuery.of(context).size.width,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10),
- color: Colors.grey[200],
- boxShadow: [
- BoxShadow(color: Colors.grey, spreadRadius: 2),
- ],
- ),
+ margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Container(
- margin: EdgeInsets.only(
- top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
- child: Text(TranslationBase.of(context).covidTest,
- style: TextStyle(
- fontSize: 18.0,
- color: Colors.black,
- fontWeight: FontWeight.bold)),
- ),
- Container(
- margin: EdgeInsets.only(bottom: 10.0),
- child: Row(
- children: [
- Container(
- margin:
- EdgeInsets.only(left: 20.0, right: 20.0),
- child: Icon(
- Icons.local_hospital,
- size: 24,
- color: Colors.grey[700],
- )),
- Container(
- child: Text(
- widget.patientShareResponse.projectName !=
- null
- ? widget
- .patientShareResponse.projectName
- : "NULL",
- style: TextStyle(
- fontSize: 18.0,
- color: Colors.grey[700])),
- ),
- ],
- ),
- ),
- Container(
- margin: EdgeInsets.only(bottom: 10.0),
- child: Row(
- children: [
- Container(
- margin:
- EdgeInsets.only(left: 20.0, right: 20.0),
- child: Icon(
- Icons.date_range,
- size: 24,
- color: Colors.grey[700],
- )),
- Container(
- child: Text(
- widget.patientShareResponse
- .appointmentDate !=
- null
- ? getDate(widget.patientShareResponse
- .appointmentDate)
- .split(" ")[0]
- : "NULL",
- style: TextStyle(
- fontSize: 18.0,
- color: Colors.grey[700])),
- ),
- ],
+ Text(
+ TranslationBase.of(context).covidAlertMins,
+ style: TextStyle(
+ fontSize: 19.0,
+ letterSpacing: -1.6,
+ fontWeight: FontWeight.bold,
),
),
- Container(
- margin: EdgeInsets.only(bottom: 10.0),
- child: Row(
- children: [
- Container(
- margin:
- EdgeInsets.only(left: 20.0, right: 20.0),
- child: Icon(
- Icons.access_time,
- size: 24,
- color: Colors.grey[700],
- )),
- Container(
- child: Text(
- widget.patientShareResponse
- .appointmentDate !=
- null
- ? getDate(widget.patientShareResponse
- .appointmentDate)
- .split(" ")[1]
- : "NULL",
- style: TextStyle(
- fontSize: 18.0,
- color: Colors.grey[700])),
- ),
- ],
+ Text(
+ TranslationBase.of(context).covidAlertInfo,
+ style: TextStyle(
+ color: Colors.grey[700],
+ fontSize: 14.0,
+ letterSpacing: -0.56,
),
),
+ mHeight(20),
Container(
- margin: EdgeInsets.only(bottom: 10.0),
- child: Row(
- children: [
- Container(
- margin:
- EdgeInsets.only(left: 20.0, right: 20.0),
- child: SvgPicture.asset(
- "assets/images/new-design/track_icon.svg",
- width: 20.0,
- height: 20.0)),
- Container(
- child: Text(
- widget.patientShareResponse.doctorNameObj !=
- null
- ? widget
- .patientShareResponse.doctorNameObj
- : "NULL",
+ width: double.infinity,
+ child: Card(
+ margin: EdgeInsets.zero,
+ shape: cardRadius(12),
+ child: Padding(
+ padding: const EdgeInsets.all(12.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ TranslationBase.of(context).appoInfo,
style: TextStyle(
- fontSize: 18.0,
- color: Colors.grey[700])),
+ fontSize: 16.0,
+ letterSpacing: -0.64,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ mHeight(16),
+ Row(
+ children: [
+ _getNormalText(
+ TranslationBase.of(context).hospital + ":",
+ ),
+ mWidth(6),
+ _getNormalText(
+ widget.patientShareResponse.projectName != null ? widget.patientShareResponse.projectName : "NULL",
+ isBold: true,
+ ),
+ ],
+ ),
+ mHeight(4),
+ Row(
+ children: [
+ _getNormalText(
+ TranslationBase.of(context).date + ":",
+ ),
+ mWidth(6),
+ _getNormalText(
+ widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[0] : "NULL",
+ isBold: true,
+ ),
+ ],
+ ),
+ mHeight(4),
+ Row(
+ children: [
+ _getNormalText(
+ TranslationBase.of(context).time + ":",
+ ),
+ mWidth(6),
+ _getNormalText(
+ widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[1] : "NULL",
+ isBold: true,
+ ),
+ ],
+ ),
+ mHeight(4),
+ Row(
+ children: [
+ _getNormalText(
+ TranslationBase.of(context).route + ":",
+ ),
+ mWidth(6),
+ _getNormalText(
+ widget.patientShareResponse.doctorNameObj != null ? widget.patientShareResponse.doctorNameObj : "NULL",
+ isBold: true,
+ ),
+ ],
+ ),
+ ],
),
- ],
+ ),
),
),
],
@@ -247,49 +168,53 @@ class _CovidPaymentAlertState extends State {
],
),
),
- Container(
- margin: EdgeInsets.all(20.0),
- child: DefaultButton(
- TranslationBase.of(context).next,
- () {
- startPaymentProcess();
- },
+ ),
+ Card(
+ margin: EdgeInsets.zero,
+ elevation: 20,
+ child: Container(
+ margin: EdgeInsets.all(12),
+ width: double.infinity,
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ minWidth: MediaQuery.of(context).size.width * 0.7,
+ height: 45.0,
+ child: RaisedButton(
+ color: CustomColors.accentColor,
+ textColor: Colors.white,
+ disabledTextColor: Colors.white,
+ disabledColor: Colors.grey[500],
+ elevation: 0,
+ onPressed: () {
+ startPaymentProcess();
+ },
+ child: Text(
+ TranslationBase.of(context).next,
+ style: TextStyle(
+ fontSize: 16.0,
+ letterSpacing: -0.48,
+ ),
+ ),
+ ),
),
),
- ],
- ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ _getNormalText(text, {bool isBold = false}) {
+ return Text(
+ text,
+ style: TextStyle(
+ fontSize: isBold ? 12 : 10,
+ letterSpacing: -0.5,
+ color: isBold ? Colors.black : Colors.grey[700],
+ fontWeight: FontWeight.w600,
),
- // bottomSheet: Container(
- // margin: EdgeInsets.all(10.0),
- // child: Flex(
- // direction: Axis.horizontal,
- // children: [
- // Expanded(
- // flex: 1,
- // child: Container(
- // margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
- // child: ButtonTheme(
- // shape: RoundedRectangleBorder(
- // borderRadius: BorderRadius.circular(10.0),
- // ),
- // minWidth: MediaQuery.of(context).size.width * 0.7,
- // height: 45.0,
- // child: RaisedButton(
- // color: new Color(0xFF60686b),
- // textColor: Colors.white,
- // disabledTextColor: Colors.white,
- // disabledColor: Colors.grey[500],
- // onPressed: () {
- // startPaymentProcess();
- // },
- // child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)),
- // ),
- // ),
- // ),
- // ),
- // ],
- // ),
- // ),
);
}
@@ -297,31 +222,32 @@ class _CovidPaymentAlertState extends State {
navigateToPaymentMethod(context, widget.patientShareResponse);
}
- Future navigateToPaymentMethod(
- context, PatientShareResponse patientShareResponse) async {
+ Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
- var data = AuthenticatedUser.fromJson(
- await this.sharedPref.getObject(USER_PROFILE));
+ var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
setState(() {
authUser = data;
});
}
+
Navigator.push(
- context, FadePage(page: PaymentMethod()))
- .then((value) {
- print(value);
- if (value != null) {
- Navigator.push(
- context,
- FadePage(
- page: CovidPaymentSummary(
- patientShareResponse: widget.patientShareResponse,
- selectedPaymentMethod: value.toString()),
- ),
- );
- }
- });
+ context,
+ FadePage(
+ page: CovidPaymentSummary(patientShareResponse: widget.patientShareResponse, selectedPaymentMethod: "MADA"),
+ ),
+ );
+ // Navigator.push(context, FadePage(page: PaymentMethod())).then((value) {
+ // print(value);
+ // if (value != null) {
+ // Navigator.push(
+ // context,
+ // FadePage(
+ // page: CovidPaymentSummary(patientShareResponse: widget.patientShareResponse, selectedPaymentMethod: value.toString()),
+ // ),
+ // );
+ // }
+ // });
}
String getDate(String appoDate) {
diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart
index a4176348..29a269af 100644
--- a/lib/pages/Covid-DriveThru/covid-payment-details.dart
+++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart
@@ -1,15 +1,18 @@
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
+import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
-import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
+import 'package:diplomaticquarterapp/uitl/utils_new.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/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
+import 'package:provider/provider.dart';
class CovidPaymentDetails extends StatefulWidget {
CovidPaymentInfoResponse covidPaymentInfoResponse;
@@ -34,60 +37,70 @@ class _CovidPaymentDetailsState extends State {
@override
Widget build(BuildContext context) {
+ ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
- showNewAppBar: true,
showNewAppBarTitle: true,
- body: SingleChildScrollView(
- child: Container(
- margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- height: 150.0,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage("assets/images/new-design/covid-19-big-banner-bg.png"),
- fit: BoxFit.fill,
- ),
- color: Colors.white.withOpacity(0.3),
- borderRadius: BorderRadius.all(Radius.circular(10))),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
- child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 90.0, height: 90.0),
- ),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
- child: Text(TranslationBase.of(context).covidTest, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 24.0)),
- ),
- Container(
- margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 10.0),
- child: Text(TranslationBase.of(context).driveThru, style: TextStyle(color: Colors.white, fontSize: 24.0)),
- ),
- ],
- ),
- ],
- ),
- ),
- Container(
- decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0), color: Colors.white),
- margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 5.0),
- padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0),
+ showNewAppBar: true,
+ backgroundColor: CustomColors.appBackgroudGrey2Color,
+ body: Container(
+ // margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0),
+
+ child: Column(
+ children: [
+ Expanded(
+ child: Padding(
+ padding: EdgeInsets.all(16),
child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Container(
- alignment: Alignment.center,
- margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0),
- child: Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 20.0, fontWeight: FontWeight.bold)),
- ),
+ // Container(
+ // height: 150.0,
+ // decoration: BoxDecoration(
+ // image: DecorationImage(
+ // image: AssetImage(
+ // "assets/images/new-design/covid-19-big-banner-bg.png"),
+ // fit: BoxFit.fill,
+ // ),
+ // color: Colors.white.withOpacity(0.3),
+ // borderRadius: BorderRadius.all(Radius.circular(10))),
+ // child: Row(
+ // crossAxisAlignment: CrossAxisAlignment.start,
+ // children: [
+ // Container(
+ // margin:
+ // EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
+ // child: SvgPicture.asset(
+ // 'assets/images/new-design/covid-19-car.svg',
+ // width: 90.0,
+ // height: 90.0),
+ // ),
+ // Column(
+ // crossAxisAlignment: CrossAxisAlignment.start,
+ // children: [
+ // Container(
+ // margin: EdgeInsets.only(
+ // left: 20.0, right: 20.0, top: 20.0),
+ // child: Text(TranslationBase.of(context).covidTest,
+ // style: TextStyle(
+ // color: Colors.white,
+ // fontWeight: FontWeight.bold,
+ // fontSize: 24.0)),
+ // ),
+ // Container(
+ // margin: EdgeInsets.only(
+ // left: 20.0, right: 20.0, top: 10.0),
+ // child: Text(TranslationBase.of(context).driveThru,
+ // style: TextStyle(
+ // color: Colors.white, fontSize: 24.0)),
+ // ),
+ // ],
+ // ),
+ // ],
+ // ),
+ // ),
+ Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold)),
...List.generate(
widget.proceduresList.length,
(index) => Column(
@@ -107,7 +120,14 @@ class _CovidPaymentDetailsState extends State {
});
},
child: ListTile(
- title: Text(widget.proceduresList[index].procedureName, style: TextStyle(fontSize: 14.0)),
+ title: Text(
+ projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName,
+ style: TextStyle(
+ fontSize: 12.0,
+ letterSpacing: -0.48,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
leading: Radio(
value: widget.proceduresList[index],
groupValue: widget.selectedProcedure,
@@ -129,111 +149,200 @@ class _CovidPaymentDetailsState extends State {
],
),
),
- Divider(),
+
+ Card(
+ shape: cardRadius(12),
+ child: Padding(
+ padding: const EdgeInsets.all(12.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(TranslationBase.of(context).testFee,
+ style: TextStyle(
+ color: Colors.black,
+ fontSize: 16.0,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.64,
+ )),
+ Container(
+ width: double.infinity,
+ padding: EdgeInsets.only(top: 10, bottom: 3),
+ child: Row(
+ children: [
+ Expanded(
+ child: _getNormalText(TranslationBase.of(context).patientShareToDo),
+ ),
+ Expanded(
+ child: _getNormalText(widget.covidPaymentInfoResponse.patientShareField.toString(), isBold: true),
+ )
+ ],
+ ),
+ ),
+ mDivider(Colors.grey[200]),
+ Container(
+ width: double.infinity,
+ padding: EdgeInsets.only(top: 3, bottom: 3),
+ child: Row(
+ children: [
+ Expanded(
+ child: _getNormalText(TranslationBase.of(context).patientTaxToDo),
+ ),
+ Expanded(
+ child: _getNormalText(widget.covidPaymentInfoResponse.patientTaxAmountField.toString(), isBold: true),
+ )
+ ],
+ ),
+ ),
+ mDivider(Colors.grey[200]),
+ Container(
+ width: double.infinity,
+ padding: EdgeInsets.only(top: 3, bottom: 3),
+ child: Row(
+ children: [
+ Expanded(
+ child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo),
+ ),
+ Expanded(
+ child: _getNormalText(widget.covidPaymentInfoResponse.patientShareWithTaxField.toString(), isBold: true),
+ )
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+
Container(
- alignment: Alignment.center,
- margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 0.0),
- child: Text(TranslationBase.of(context).testFee, style: TextStyle(color: Colors.black, fontSize: 22.0, fontWeight: FontWeight.bold)),
+ margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ Checkbox(
+ value: isAgree,
+ onChanged: (value) {
+ setState(() {
+ isAgree = !isAgree;
+ });
+ },
+ activeColor: Color(0xffB8382C),
+ ),
+ Text(
+ TranslationBase.of(context).agreeTo,
+ style: TextStyle(
+ fontSize: 12,
+ letterSpacing: -0.48,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ mWidth(3),
+ Text(
+ TranslationBase.of(context).termsConditoins,
+ style: TextStyle(
+ fontSize: 12,
+ letterSpacing: -0.48,
+ color: CustomColors.accentColor,
+ fontWeight: FontWeight.w600,
+ decoration: TextDecoration.underline,
+ ),
+ ),
+ ],
+ ),
),
- Table(
- children: [
- TableRow(children: [
- TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)),
- TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientShareField.toString())),
- ]),
- TableRow(children: [
- TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)),
- TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientTaxAmountField.toString())),
- ]),
- TableRow(children: [
- TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
- TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientShareWithTaxField.toString())),
- ]),
- ],
+ mFlex(1),
+
+ Text(
+ TranslationBase.of(context).payOptions,
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 12.0,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.46,
+ ),
),
- ],
- ),
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 5.0),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- Checkbox(
- value: isAgree,
- onChanged: (value) {
- setState(() {
- isAgree = !isAgree;
- });
- },
- activeColor: Color(0xffB8382C),
+ Container(
+ margin: EdgeInsets.only(top: 12, bottom: 12),
+ child: Image.asset("assets/images/new-design/payment_options_invoice_confirmation.png", width: 300),
),
- Texts(TranslationBase.of(context).iAgreeToTheTermsAndConditions),
],
),
),
- Divider(
- color: Colors.grey,
- ),
- Container(
- alignment: Alignment.center,
- margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0),
- child: Text(TranslationBase.of(context).payOptions, textAlign: TextAlign.center, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, fontFamily: "Open-Sans")),
- ),
- Container(
- alignment: Alignment.center,
- margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0),
- child: Image.asset("assets/images/new-design/payment_options_invoice_confirmation.png", width: 300),
- ),
- ],
- ),
- ),
- ),
- bottomSheet: Container(
- color: Colors.grey[100],
- padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0),
- child: Flex(
- direction: Axis.horizontal,
- children: [
- Expanded(
- flex: 1,
- child: Container(
- margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
- child: ButtonTheme(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
- ),
- minWidth: MediaQuery.of(context).size.width * 0.7,
- height: 45.0,
- child: DefaultButton(TranslationBase.of(context).cancel, () {
- cancel();
- }, color: Color(0xffEAEAEA), textColor: Color(0xff000000)),
- ),
- ),
),
- Expanded(
- flex: 1,
- child: Container(
- margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
- child: ButtonTheme(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
- ),
- minWidth: MediaQuery.of(context).size.width * 0.7,
- height: 45.0,
- child: DefaultButton(
- TranslationBase.of(context).next,
- isAgree
- ? () {
- next();
- }
- : null,
- disabledColor: Color(0x8ac5272d),
+ Container(
+ width: double.infinity,
+ child: Card(
+ elevation: 20,
+ margin: EdgeInsets.zero,
+ child: Padding(
+ padding: const EdgeInsets.only(top: 12, bottom: 12, left: 12, right: 12),
+ child: Row(
+ children: [
+ Expanded(
+ flex: 1,
+ child: Container(
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ minWidth: MediaQuery.of(context).size.width * 0.7,
+ height: 45.0,
+ child: RaisedButton(
+ color: CustomColors.darkGreyColor,
+ textColor: Colors.white,
+ elevation: 0,
+ disabledTextColor: Colors.white,
+ disabledColor: Colors.grey[500],
+ onPressed: () {
+ cancel();
+ },
+ child: Text(
+ TranslationBase.of(context).cancel,
+ style: TextStyle(
+ fontSize: 16.0,
+ letterSpacing: -0.48,
+ color: Colors.black,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ mWidth(12),
+ Expanded(
+ flex: 1,
+ child: Container(
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ minWidth: MediaQuery.of(context).size.width * 0.7,
+ height: 45.0,
+ child: RaisedButton(
+ color: CustomColors.accentColor,
+ textColor: Colors.white,
+ elevation: 0,
+ disabledTextColor: Colors.white,
+ disabledColor: Colors.grey[500],
+ onPressed: isAgree ? next : null,
+ child: Text(
+ TranslationBase.of(context).next,
+ style: TextStyle(
+ fontSize: 16.0,
+ letterSpacing: -0.48,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
),
),
),
- ),
+ )
],
),
),
@@ -269,10 +378,15 @@ class _CovidPaymentDetailsState extends State {
});
}
- _getNormalText(text) {
- return Container(
- margin: EdgeInsets.only(top: 20.0, right: 10.0),
- child: Text(text, textAlign: TextAlign.end, style: TextStyle(fontSize: 15, fontFamily: 'Open-Sans', letterSpacing: 0.5, color: Colors.grey[700])),
+ _getNormalText(text, {bool isBold = false}) {
+ return Text(
+ text,
+ style: TextStyle(
+ fontSize: isBold ? 12 : 10,
+ letterSpacing: -0.5,
+ color: isBold ? Colors.black : Colors.grey[700],
+ fontWeight: FontWeight.w600,
+ ),
);
}
}
diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart
index f6ed41a3..62eb6942 100644
--- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart
+++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart
@@ -2,16 +2,18 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
-import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
+import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
+import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
-import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
-import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
+import 'package:diplomaticquarterapp/uitl/utils_new.dart';
+import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
+import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@@ -22,7 +24,7 @@ import 'package:provider/provider.dart';
class CovidPaymentSummary extends StatefulWidget {
PatientShareResponse patientShareResponse;
- final String selectedPaymentMethod;
+ String selectedPaymentMethod;
MyInAppBrowser browser;
AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences();
@@ -41,8 +43,9 @@ class _CovidPaymentSummaryState extends State {
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
- showNewAppBarTitle: true,
showNewAppBar: true,
+ showNewAppBarTitle: true,
+ backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
@@ -50,28 +53,65 @@ class _CovidPaymentSummaryState extends State {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Texts(
+ Text(
TranslationBase.of(context).confirmThePayment,
- textAlign: TextAlign.center,
- fontWeight: FontWeight.w500,
- fontSize: 24,
+ style: TextStyle(
+ fontSize: 19,
+ fontWeight: FontWeight.bold,
+ letterSpacing: -1.46,
+ ),
),
SizedBox(
height: 12,
),
Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
+ Text(
+ TranslationBase.of(context).totalBalance + ": ",
+ style: TextStyle(
+ fontSize: 12,
+ letterSpacing: -0.60,
+ ),
+ ),
+ Text(
+ '${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar,
+ style: TextStyle(
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
+ letterSpacing: -0.60,
+ ),
+ )
+ ],
+ ),
+ SizedBox(
+ height: 12,
+ ),
+ Row(
+ children: [
+ Container(
+ width: 20,
+ height: 20,
+ decoration: containerColorRadiusBorderWidth(CustomColors.accentColor, 200, Colors.white, 4),
+ ),
Container(
- height: 100.0,
+ height: 60.0,
padding: EdgeInsets.all(7.0),
- width: MediaQuery.of(context).size.width * 0.45,
child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)),
),
- Texts(
- '${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar,
- fontSize: 26,
- bold: true,
+ mFlex(1),
+ InkWell(
+ onTap: () {
+ showDraggableDialog(context, PaymentMethod(
+ onSelectedMethod: (String metohd) {
+ widget.selectedPaymentMethod = metohd;
+ setState(() {});
+ },
+ ));
+ },
+ child: Text(
+ TranslationBase.of(context).changePayment,
+ style: TextStyle(fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: -0.48, decoration: TextDecoration.underline, color: CustomColors.accentColor),
+ ),
)
],
),
@@ -81,53 +121,47 @@ class _CovidPaymentSummaryState extends State {
Row(
children: [
Expanded(
- child: Container(
- margin: EdgeInsets.all(3),
- child: NewTextFields(
- hintText: TranslationBase.of(context).fileNumber,
- initialValue: projectViewModel.user.patientID.toString(),
- isEnabled: false,
- ),
+ flex: 1,
+ child: showDetail(
+ TranslationBase.of(context).fileNumber,
+ projectViewModel.user.patientID.toString(),
),
),
+ mWidth(6),
Expanded(
- child: Container(
- margin: EdgeInsets.all(3),
- child: NewTextFields(
- hintText: TranslationBase.of(context).name,
- initialValue: projectViewModel.user.firstName,
- isEnabled: false,
- ),
+ flex: 1,
+ child: showDetail(
+ TranslationBase.of(context).name,
+ projectViewModel.user.firstName.toString(),
),
),
],
),
SizedBox(
- height: 12,
- ),
- NewTextFields(
- hintText: TranslationBase.of(context).mobileNumber,
- initialValue: projectViewModel.user.mobileNumber,
- isEnabled: false,
+ height: 6,
),
+ showDetail(TranslationBase.of(context).mobileNumber, projectViewModel.user.mobileNumber),
SizedBox(
- height: 12,
- ),
- NewTextFields(
- hintText: TranslationBase.of(context).depositorName,
- initialValue: projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName,
- isEnabled: false,
+ height: 6,
),
+ showDetail(
+ TranslationBase.of(context).depositorName,
+ projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName,
+ )
],
),
),
),
bottomSheet: Container(
- color: Colors.grey[100],
+ color: Colors.white,
+ height: MediaQuery.of(context).size.height * 0.1,
+ width: double.infinity,
padding: EdgeInsets.all(12),
- child: DefaultButton(
- TranslationBase.of(context).confirm.toUpperCase(),
- () {
+ child: SecondaryButton(
+ textColor: Colors.white,
+ color: CustomColors.green,
+ label: TranslationBase.of(context).confirm.toUpperCase(),
+ onTap: () {
startPaymentProcess(projectViewModel.user);
},
),
@@ -135,6 +169,32 @@ class _CovidPaymentSummaryState extends State {
);
}
+ Widget showDetail(String title, String value) {
+ return Container(
+ width: double.infinity,
+ child: Card(
+ shape: cardRadius(12),
+ margin: EdgeInsets.zero,
+ child: Padding(
+ padding: const EdgeInsets.all(12.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ title,
+ style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.64),
+ ),
+ Text(
+ value,
+ style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.64, color: Colors.grey),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
startPaymentProcess(AuthenticatedUser authenticatedUser) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientShareResponse.projectID;
diff --git a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart
index ed6078ff..565658d3 100644
--- a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart
+++ b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart
@@ -1,71 +1,80 @@
-
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5));
-class RRTLogListItem extends StatelessWidget{
+class RRTLogListItem extends StatelessWidget {
final PrescriptionsOrder order;
final Function(PrescriptionsOrder) onCancel;
+
RRTLogListItem(this.order, {this.onCancel});
BuildContext _context;
TranslationBase localize;
+
@override
Widget build(BuildContext context) {
+ ProjectViewModel projectViewModel = Provider.of(context);
_context = context;
localize = TranslationBase.of(context);
return Container(
- padding: EdgeInsets.all(15), margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(15),
- boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)]
- ),
+ padding: EdgeInsets.all(15),
+ margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
+ decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15), boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)]),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_contentItem(label: localize.reqId, value: order.iD.toString()),
_item_content_seperator,
- _contentItem(label: localize.status, value: order.getStatusName(localize)),
+ _contentItem(label: localize.status, value: projectViewModel.isArabic ? order.descriptionN.toString() : order.description.toString()), //order.getStatusName(localize)),
_item_content_seperator,
_contentItem(label: localize.pickupDate, value: order.getFormattedDateTime()),
_item_content_seperator,
_contentItem(label: localize.location, value: order.getNearestProjectDescription()),
_item_content_seperator,
SizedBox(height: 10),
-
- if(onCancel != null)
- FractionallySizedBox(child: cancelButton())
+ if (onCancel != null && order.status == 1 && order.status == 2) FractionallySizedBox(child: cancelButton())
],
),
);
}
- Widget _contentItem({@required String label, String value}){
+ Widget _contentItem({@required String label, String value}) {
return Container(
padding: EdgeInsets.symmetric(vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(label, style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),),
- SizedBox(height: 5,),
- Text(value, style: TextStyle(color: Theme.of(_context).appBarTheme.color,fontWeight: FontWeight.bold, fontSize: 14),),
+ Text(
+ label,
+ style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),
+ ),
+ SizedBox(
+ height: 5,
+ ),
+ Text(
+ value,
+ style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontWeight: FontWeight.bold, fontSize: 14),
+ ),
],
),
);
}
Widget cancelButton() => MaterialButton(
- height: 45,
- color: Color(0xFFc5272d),
- shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
- onPressed: () => onCancel(order),
- child: Text(localize.cancel, style: TextStyle(color: Colors.white, fontSize: 13),),
-
- );
+ height: 45,
+ color: Color(0xFFc5272d),
+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
+ onPressed: () => onCancel(order),
+ child: Text(
+ localize.cancel,
+ style: TextStyle(color: Colors.white, fontSize: 13),
+ ),
+ );
}
diff --git a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart
index 6898dcbb..f2eed14b 100644
--- a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart
+++ b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart
@@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.dart';
+import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart';
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@@ -9,7 +10,6 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
-import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
@@ -36,97 +36,87 @@ class RRTPlaceOrderPage extends StatelessWidget {
onModelReady: (vm) => viewModel = vm,
builder: (ctx, vm, wState) {
return AppScaffold(
- appBarTitle: localize.rapidResponseTeam,
- isShowAppBar: true,
- showNewAppBarTitle: true,
- showNewAppBar: true,
- body: Column(
+ appBarTitle: localize.rapidResponseTeam,
+ isShowAppBar: true,
+ showNewAppBarTitle: true,
+ showNewAppBar: true,
+ body: SingleChildScrollView(
+ padding: EdgeInsets.all(20),
+ child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
- Expanded(
- child: SingleChildScrollView(
- padding: EdgeInsets.all(20),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- Text(
- localize.selectedLocation,
- style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
- ),
- selectedAddressField(),
- AspectRatio(
- aspectRatio: 3 / 1,
- child: ClipRRect(
- clipBehavior: Clip.hardEdge,
- borderRadius: BorderRadius.circular(10),
- child: Image.network(
- "https://maps.googleapis.com/maps/api/staticmap?center=$lat,$lng &zoom=16&size=800x600&maptype=roadmap&markers=color:red%7C$lat,$lng&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
- fit: BoxFit.cover,
- ),
- ),
- ),
- SizedBox(
- height: 10,
- ),
- Container(
- height: 80,
- margin: EdgeInsets.symmetric(vertical: 5),
- padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(10),
- boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2, 2), color: Colors.grey.withOpacity(0.25))]),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- localize.totalAmountPayable,
- style: TextStyle(fontSize: 13),
- ),
- SizedBox(
- height: 5,
- ),
- Text(
- "${servicePrice.totalPrice ?? '- - -'} ${localize.sar}",
- style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
- ),
- ],
- ),
- ),
- Container(
- height: 70,
- margin: EdgeInsets.symmetric(vertical: 5),
- padding: EdgeInsets.symmetric(horizontal: 0, vertical: 10),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(10),
- boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2, 2), color: Colors.grey.withOpacity(0.25))]),
- child: TextField(
- controller: noteController,
- style: TextStyle(fontSize: 18.0),
- decoration: InputDecoration(
- filled: true,
- fillColor: Colors.white,
- labelText: localize.notes,
- contentPadding: const EdgeInsets.only(left: 14.0, bottom: 8.0, top: 8.0),
- focusedBorder: OutlineInputBorder(
- borderSide: BorderSide(color: Colors.white),
- borderRadius: BorderRadius.circular(10),
- ),
- enabledBorder: UnderlineInputBorder(
- borderSide: BorderSide(color: Colors.white),
- borderRadius: BorderRadius.circular(10),
- ),
- )),
- ),
- ],
+ Text(
+ localize.selectedLocation,
+ style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
+ ),
+ selectedAddressField(),
+ AspectRatio(
+ aspectRatio: 3 / 1,
+ child: ClipRRect(
+ clipBehavior: Clip.hardEdge,
+ borderRadius: BorderRadius.circular(10),
+ child: Image.network(
+ "https://maps.googleapis.com/maps/api/staticmap?center=$lat,$lng &zoom=16&size=800x600&maptype=roadmap&markers=color:red%7C$lat,$lng&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
+ fit: BoxFit.cover,
),
),
),
- submitButton(context)
+ SizedBox(
+ height: 10,
+ ),
+ Container(
+ height: 85,
+ margin: EdgeInsets.symmetric(vertical: 5),
+ padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
+ decoration: BoxDecoration(
+ color: Colors.white, borderRadius: BorderRadius.circular(10), boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2, 2), color: Colors.grey.withOpacity(0.25))]),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ localize.patientShareWithTax,
+ style: TextStyle(fontSize: 13),
+ ),
+ SizedBox(
+ height: 5,
+ ),
+ Text(
+ "${servicePrice.totalPrice ?? '- - -'} ${localize.sar}",
+ style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
+ ),
+ ],
+ ),
+ ),
+ Container(
+ height: 70,
+ margin: EdgeInsets.symmetric(vertical: 5),
+ padding: EdgeInsets.symmetric(horizontal: 0, vertical: 10),
+ decoration: BoxDecoration(
+ color: Colors.white, borderRadius: BorderRadius.circular(10), boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2, 2), color: Colors.grey.withOpacity(0.25))]),
+ child: TextField(
+ controller: noteController,
+ style: TextStyle(fontSize: 18.0),
+ decoration: InputDecoration(
+ filled: true,
+ fillColor: Colors.white,
+ labelText: localize.notes,
+ contentPadding: const EdgeInsets.only(left: 14.0, bottom: 8.0, top: 8.0),
+ focusedBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.white),
+ borderRadius: BorderRadius.circular(10),
+ ),
+ enabledBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: Colors.white),
+ borderRadius: BorderRadius.circular(10),
+ ),
+ )),
+ ),
],
- ));
+ ),
+ ),
+ bottomSheet: submitButton(context),
+ );
},
);
}
@@ -135,33 +125,34 @@ class RRTPlaceOrderPage extends StatelessWidget {
var address = "${selectedAddress.address1 ?? ''} ${selectedAddress.address2 ?? ''}";
return Container(
margin: EdgeInsets.symmetric(vertical: 10),
- child: Expanded(
- child: MaterialButton(
- height: 50,
- color: Colors.white,
- shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
- onPressed: () {},
- child: Row(
- children: [
- Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 15, letterSpacing: 1))),
- Icon(
- Icons.location_on_rounded,
- size: 30,
- color: Colors.black,
- )
- ],
- ),
+ child: MaterialButton(
+ height: 50,
+ color: Colors.white,
+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
+ onPressed: () {},
+ child: Row(
+ children: [
+ Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 15, letterSpacing: 1))),
+ Icon(
+ Icons.location_on_rounded,
+ size: 30,
+ color: Colors.black,
+ )
+ ],
),
),
);
}
Widget submitButton(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.all(15),
- child: DefaultButton(
- localize.submit,
- () => placeOrder(),
+ return Container(
+ color: Theme.of(context).scaffoldBackgroundColor,
+ child: Padding(
+ padding: const EdgeInsets.all(15),
+ child: DefaultButton(
+ localize.submit,
+ () => placeOrder(),
+ ),
),
);
}
@@ -176,21 +167,34 @@ class RRTPlaceOrderPage extends StatelessWidget {
params['Latitude'] = latlng.latitude;
params['Longitude'] = latlng.longitude;
params['Notes'] = noteController.text;
+ // var response = await viewModel.createOrder(params);
var requestId = await viewModel.createOrder(params);
GifLoaderDialogUtils.hideDialog(_context);
if (requestId != null) {
- AlertDialogBox(
- context: _context,
- title: '',
- confirmMessage: localize.rrtOrderSuccessMessage,
- okText: localize.ok,
- okFunction: () {
- AlertDialogBox.closeAlertDialog(_context);
- gotoRRTRoot();
- }).showAlertDialog(_context);
+ showCMCConfirmDialog(
+ _context,
+ requestId.toString(),
+ onClick: () {
+ gotoRRTRoot();
+ // Navigator.pop(_context);
+ // Navigator.pop(_context);
+ },
+ );
}
+
+ // if (requestId != null) {
+ // AlertDialogBox(
+ // context: _context,
+ // title: '',
+ // confirmMessage: localize.rrtOrderSuccessMessage,
+ // okText: localize.ok,
+ // okFunction: () {
+ // AlertDialogBox.closeAlertDialog(_context);
+ // gotoRRTRoot();
+ // }).showAlertDialog(_context);
+ // }
} else {
AppToast.showErrorToast(message: 'Invalid location selected');
}
diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart
index 984ee35b..5b91e367 100644
--- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart
+++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart
@@ -1,10 +1,10 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.dart';
-import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-agreement-page.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
+import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@@ -25,13 +25,10 @@ class RRTRequestPage extends StatefulWidget {
class RRTRequestPageState extends State {
bool acceptTerms = false;
-
- TranslationBase localize;
RRTViewModel viewModel;
@override
Widget build(BuildContext context) {
- localize = TranslationBase.of(context);
return BaseView(
onModelReady: (vm) {
viewModel = vm;
@@ -63,7 +60,8 @@ class RRTRequestPageState extends State {
Container(
padding: EdgeInsets.only(top: 20, bottom: 5),
alignment: Alignment.center,
- child: Text(localize.youCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2)),
+ child: Text(TranslationBase.of(context).youCanPayByTheFollowingOptions,
+ style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2)),
paymentOptions(),
],
@@ -87,7 +85,7 @@ class RRTRequestPageState extends State {
Widget serviceDescription(BuildContext context) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(
- localize.rrtDDetails,
+ TranslationBase.of(context).rrtDDetails,
textAlign: TextAlign.justify,
style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300),
),
@@ -104,13 +102,13 @@ class RRTRequestPageState extends State {
Container(
height: 30,
decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)),
- child: Center(child: Text(localize.approximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))),
+ child: Center(child: Text(TranslationBase.of(context).approximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))),
),
- pricingRow(label: localize.amountBeforeTax, value: '$amount ${localize.sar}'),
+ pricingRow(label: TranslationBase.of(context).patientShare, value: '$amount ${TranslationBase.of(context).sar}'),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
- pricingRow(label: localize.taxAmount, value: '$vat ${localize.sar}'),
+ pricingRow(label: TranslationBase.of(context).patientTaxToDo, value: '$vat ${TranslationBase.of(context).sar}'),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
- pricingRow(label: localize.totalAmountPayable, value: '$total ${localize.sar}', labelBold: true),
+ pricingRow(label: TranslationBase.of(context).patientShareWithTax, value: '$total ${TranslationBase.of(context).sar}', labelBold: true),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
],
);
@@ -149,14 +147,19 @@ class RRTRequestPageState extends State {
setState(() => acceptTerms = v);
}),
SizedBox(width: 10),
- Expanded(child: Text(localize.iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2)),
+ Expanded(child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2)),
Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width * 0.25,
child: TextButton(
- child: Text(localize.clickHere, style: TextStyle(fontSize: 12, color: Colors.blue, fontWeight: FontWeight.w400)),
+ child: Text(TranslationBase.of(context).clickHere, style: TextStyle(fontSize: 12, color: Colors.blue, fontWeight: FontWeight.w400)),
onPressed: () {
- Navigator.push(context, FadePage(page: RRTAgreementPage()));
+ Navigator.push(
+ context,
+ FadePage(
+ page: UserAgreementContent(),
+ ),
+ );
}),
)
],
@@ -184,7 +187,7 @@ class RRTRequestPageState extends State {
if (acceptTerms)
goToPickupAddress();
else
- AppToast.showErrorToast(message: localize.pleaseAcceptTerms);
+ AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
},
),
),
diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart
index 3883432b..13b86071 100644
--- a/lib/pages/MyAppointments/AppointmentDetails.dart
+++ b/lib/pages/MyAppointments/AppointmentDetails.dart
@@ -107,7 +107,7 @@ class _AppointmentDetailsState extends State with SingleTick
"",
//model.user.emailAddress,
),
- isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
+ isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
buttonTitle: TranslationBase.of(context).schedule,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false,
@@ -136,7 +136,7 @@ class _AppointmentDetailsState extends State with SingleTick
onTap: (index) {
setState(() {
if (index == 1) {
- if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) {
+ if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) {
_tabController.index = _tabController.previousIndex;
AppointmentDetails.showFooterButton = false;
} else {
@@ -147,7 +147,7 @@ class _AppointmentDetailsState extends State with SingleTick
},
tabs: [
Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))),
- widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment
+ widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment
? Tab(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
)
diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart
index e7f56c61..b7a257aa 100644
--- a/lib/pages/ToDoList/ToDo.dart
+++ b/lib/pages/ToDoList/ToDo.dart
@@ -121,7 +121,8 @@ class _ToDoState extends State {
DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") +
" " +
- widget.appoList[index].startTime.substring(0, 5), overflow: TextOverflow.clip,
+ widget.appoList[index].startTime.substring(0, 5),
+ overflow: TextOverflow.clip,
style: TextStyle(fontSize: 10.0)),
),
!widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(),
@@ -743,7 +744,10 @@ class _ToDoState extends State {
});
}
- Navigator.push(context, FadePage(page: PaymentMethod())).then((value) {
+ Navigator.push(context, FadePage(page: PaymentMethod(
+ onSelectedMethod: (String metohd) {
+ setState(() {});
+ }))).then((value) {
print(value);
getPatientAppointmentHistory();
diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart
index 30b0dd47..fef55190 100644
--- a/lib/pages/ToDoList/payment_method_select.dart
+++ b/lib/pages/ToDoList/payment_method_select.dart
@@ -2,11 +2,16 @@ import 'dart:io';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget {
+ Function onSelectedMethod;
+
+ PaymentMethod({this.onSelectedMethod});
+
@override
_PaymentMethodState createState() => _PaymentMethodState();
}
@@ -21,7 +26,7 @@ class _PaymentMethodState extends State {
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
- backgroundColor: CustomColors.appBackgroudGreyColor,
+ backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container(
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: SingleChildScrollView(
@@ -33,154 +38,224 @@ class _PaymentMethodState extends State {
Container(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
alignment: Alignment.center,
- child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 26.0, fontWeight: FontWeight.bold)),
+ child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)),
),
Container(
- margin: EdgeInsets.only(top: 25.0),
- child: Flex(
- direction: Axis.horizontal,
- children: [
- Expanded(
- child: Container(
- child: InkWell(
- onTap: () {
- updateSelectedPaymentMethod("MADA");
- },
- child: Card(
- elevation: 3.0,
- margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
- color: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10),
- side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
- ),
- child: Container(
- height: 120.0,
- padding: EdgeInsets.all(7.0),
- width: MediaQuery.of(context).size.width * 0.45,
- child: Image.asset("assets/images/new-design/mada.png"),
- ),
- ),
- ),
- ),
+ width: double.infinity,
+ child: InkWell(
+ onTap: () {
+ updateSelectedPaymentMethod("MADA");
+ },
+ child: Card(
+ elevation: 3.0,
+ margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
+ color: Colors.white,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10),
+ side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
),
- Expanded(
- child: Container(
- child: InkWell(
- onTap: () {
- updateSelectedPaymentMethod("VISA");
- },
- child: Card(
- elevation: 3.0,
- margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
- color: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10),
- side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
- ),
- child: Container(
- height: 120.0,
- padding: EdgeInsets.all(7.0),
- width: MediaQuery.of(context).size.width * 0.45,
- child: Image.asset("assets/images/new-design/visa.png"),
- ),
- ),
+ child: Row(
+ children: [
+ Container(
+ height: 60.0,
+ width: 60,
+ padding: EdgeInsets.all(7.0),
+ child: Image.asset("assets/images/new-design/mada.png"),
),
- ),
+ mWidth(12),
+ Text(
+ "Mada",
+ style: TextStyle(
+ color: Colors.black,
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
+ ),
+ )
+ ],
),
- ],
+ ),
),
),
Container(
- margin: EdgeInsets.only(top: 25.0),
- child: Flex(
- direction: Axis.horizontal,
- children: [
- Expanded(
- child: Container(
- child: InkWell(
- onTap: () {
- updateSelectedPaymentMethod("MASTERCARD");
- },
- child: Card(
- elevation: 3.0,
- margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
- color: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10),
- side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
- ),
- child: Container(
- height: 120.0,
- padding: EdgeInsets.all(7.0),
- width: MediaQuery.of(context).size.width * 0.45,
- child: Image.asset("assets/images/new-design/mastercard.png"),
- ),
- ),
+ width: double.infinity,
+ child: InkWell(
+ onTap: () {
+ updateSelectedPaymentMethod("VISA");
+ },
+ child: Card(
+ elevation: 3.0,
+ margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
+ color: Colors.white,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10),
+ side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
+ ),
+ child: Row(
+ children: [
+ Container(
+ height: 60.0,
+ padding: EdgeInsets.all(7.0),
+ width: 60,
+ child: Image.asset("assets/images/new-design/visa.png"),
),
- ),
+ mWidth(12),
+ Text(
+ "VISA",
+ style: TextStyle(
+ color: Colors.black,
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
+ ),
+ )
+ ],
+ ),
+ ),
+ ),
+ ),
+ Container(
+ width: double.infinity,
+ child: InkWell(
+ onTap: () {
+ updateSelectedPaymentMethod("MASTERCARD");
+ },
+ child: Card(
+ elevation: 3.0,
+ margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
+ color: Colors.white,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10),
+ side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
),
- Expanded(
- child: Container(
- child: InkWell(
- onTap: () {
- updateSelectedPaymentMethod("Installment");
- },
- child: Card(
- elevation: 3.0,
- margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
- color: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10),
- side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
- ),
- child: Container(
- height: 120.0,
- padding: EdgeInsets.all(7.0),
- width: MediaQuery.of(context).size.width * 0.45,
- child: Image.asset("assets/images/new-design/installment.png"),
- ),
+ child: Row(
+ children: [
+ Container(
+ height: 60.0,
+ padding: EdgeInsets.all(7.0),
+ width: 60,
+ child: Image.asset("assets/images/new-design/mastercard.png"),
+ ),
+ mWidth(12),
+ Text(
+ "MasterCard",
+ style: TextStyle(
+ color: Colors.black,
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
),
+ )
+ ],
+ ),
+ ),
+ ),
+ ),
+ Container(
+ width: double.infinity,
+ child: InkWell(
+ onTap: () {
+ updateSelectedPaymentMethod("Installment");
+ },
+ child: Card(
+ elevation: 3.0,
+ margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
+ color: Colors.white,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10),
+ side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
+ ),
+ child: Row(
+ children: [
+ Container(
+ height: 60.0,
+ padding: EdgeInsets.all(7.0),
+ width: 60,
+ child: Image.asset("assets/images/new-design/installment.png"),
),
- ),
+ mWidth(12),
+ Text(
+ "Installments",
+ style: TextStyle(
+ color: Colors.black,
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
+ ),
+ )
+ ],
),
- ],
+ ),
),
),
- Platform.isIOS ? Container(
- margin: EdgeInsets.only(top: 25.0),
- child: Flex(
- direction: Axis.horizontal,
- children: [
- Expanded(
- child: Container(
- child: InkWell(
- onTap: () {
- updateSelectedPaymentMethod("ApplePay");
- },
- child: Card(
- elevation: 3.0,
- margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
- color: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10),
- side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
- ),
- child: Container(
- height: 120.0,
- padding: EdgeInsets.all(20.0),
- child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
- ),
+ Platform.isIOS
+ ? Container(
+ width: double.infinity,
+ child: InkWell(
+ onTap: () {
+ updateSelectedPaymentMethod("ApplePay");
+ },
+ child: Card(
+ elevation: 3.0,
+ margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
+ color: Colors.white,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10),
+ side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
+ ),
+ child: Row(
+ children: [
+ Container(
+ height: 60.0,
+ padding: EdgeInsets.all(7.0),
+ width: 60,
+ child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
+ ),
+ mWidth(12),
+ Text(
+ "Apple Pay",
+ style: TextStyle(
+ color: Colors.black,
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
+ ),
+ )
+ ],
),
),
),
- ),
- Expanded(
- child: Container(),
- ),
- ],
- ),
- ) : Container(),
+ )
+ // Container(
+ // margin: EdgeInsets.only(top: 25.0),
+ // child: Flex(
+ // direction: Axis.horizontal,
+ // children: [
+ // Expanded(
+ // child: Container(
+ // child: InkWell(
+ // onTap: () {
+ // updateSelectedPaymentMethod("ApplePay");
+ // },
+ // child: Card(
+ // elevation: 3.0,
+ // margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
+ // color: Colors.white,
+ // shape: RoundedRectangleBorder(
+ // borderRadius: BorderRadius.circular(10),
+ // side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
+ // ),
+ // child: Container(
+ // height: 120.0,
+ // padding: EdgeInsets.all(20.0),
+ // child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
+ // ),
+ // ),
+ // ),
+ // ),
+ // ),
+ // Expanded(
+ // child: Container(),
+ // ),
+ // ],
+ // ),
+ // )
+ : Container(),
SizedBox(
height: 150.0,
),
@@ -190,7 +265,7 @@ class _PaymentMethodState extends State {
),
),
bottomSheet: Container(
- padding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
+ padding: EdgeInsets.all(16),
color: Colors.white,
child: Container(
width: MediaQuery.of(context).size.width,
@@ -208,7 +283,9 @@ class _PaymentMethodState extends State {
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
+ elevation: 0,
onPressed: () {
+ widget.onSelectedMethod(selectedPaymentMethod);
Navigator.pop(context, selectedPaymentMethod);
},
child: Text(TranslationBase.of(context).confirm.toUpperCase(),
diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart
index b56ea43f..669e14f9 100644
--- a/lib/pages/landing/fragments/home_page_fragment2.dart
+++ b/lib/pages/landing/fragments/home_page_fragment2.dart
@@ -79,7 +79,7 @@ class _HomePageFragment2State extends State {
padding: const EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6),
child: InkWell(
onTap: () {
- navigateTo(context, MedicalProfilePageNew());
+ widget.onMedicalFileClick();
},
child: LoggedSliderView(
projectViewModel,
diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart
index 0e88f588..41f5cf63 100644
--- a/lib/pages/landing/landing_page.dart
+++ b/lib/pages/landing/landing_page.dart
@@ -233,13 +233,14 @@ class _LandingPageState extends State with WidgetsBindingObserver {
_firebaseMessaging.setAutoInitEnabled(true);
// signalRUtil = new SignalRUtil(hubName: "http://192.168.8.101:5001/chatHub", context: context);
+ signalRUtil = new SignalRUtil(hubName: "https://api.cssynapses.com/chatsocket", context: context);
locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
familyFileProvider.getSharedRecordByStatus();
}
- // signalRUtil.startSignalRConnection();
+ signalRUtil.startSignalRConnection();
});
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
//for now commented to reduce this call will enable it when needed
diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart
index a45e6f3e..06070a7f 100644
--- a/lib/pages/livecare/livecare_home.dart
+++ b/lib/pages/livecare/livecare_home.dart
@@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingRequest.dart';
@@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
class LiveCareHome extends StatefulWidget {
static bool showFooterButton = true;
@@ -30,7 +32,7 @@ class _LiveCareHomeState extends State with SingleTickerProviderSt
ErRequestHistoryList pendingERRequestHistoryList;
- AuthenticatedUserObject authenticatedUserObject = locator();
+ ProjectViewModel projectViewModel;
@override
void initState() {
@@ -39,9 +41,9 @@ class _LiveCareHomeState extends State with SingleTickerProviderSt
pendingERRequestHistoryList = new ErRequestHistoryList();
imagesInfo.add(ImagesInfo(
- imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/ar/0.png'));
+ imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_ar/ar/0.png'));
WidgetsBinding.instance.addPostFrameCallback((_) {
- if (!isDataLoaded && authenticatedUserObject.isLogin) getLiveCareHistory();
+ if (!isDataLoaded && projectViewModel.isLogin) getLiveCareHistory();
});
super.initState();
@@ -49,6 +51,7 @@ class _LiveCareHomeState extends State with SingleTickerProviderSt
@override
Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).livecare,
isShowAppBar: true,
diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart
index 36e8274f..785fcb71 100644
--- a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart
+++ b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart
@@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
@@ -8,8 +9,10 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
+import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
class LiveCareHistoryCard extends StatefulWidget {
ErRequestHistoryList erRequestHistoryList;
@@ -24,6 +27,8 @@ class _LiveCareHistoryCardState extends State {
AuthenticatedUser authUser = new AuthenticatedUser();
AppSharedPreferences sharedPref = AppSharedPreferences();
+ ProjectViewModel projectViewModel;
+
@override
void initState() {
getAuthenticatedUser();
@@ -32,6 +37,7 @@ class _LiveCareHistoryCardState extends State {
@override
Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
return Container(
margin: EdgeInsets.all(10.0),
child: Card(
@@ -48,23 +54,14 @@ class _LiveCareHistoryCardState extends State {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
- Text("Requested date:",
- style:
- TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
+ Text(TranslationBase.of(context).requestedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
Container(
- margin: EdgeInsets.only(top: 10.0),
+ margin: EdgeInsets.only(top: 0.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Text(widget.erRequestHistoryList.sArrivalTime,
- style: TextStyle(fontSize: 14.0)),
- Text(
- "Call Duration\n" +
- getCallTime(
- widget.erRequestHistoryList.callDuration),
- textAlign: TextAlign.center,
- style:
- TextStyle(fontSize: 14.0, color: Colors.grey[600])),
+ Text(widget.erRequestHistoryList.sArrivalTime, style: TextStyle(fontSize: 14.0)),
+ Text(TranslationBase.of(context).callDuration + "\n" + getCallTime(widget.erRequestHistoryList.callDuration), textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.grey[600])),
],
),
),
@@ -76,8 +73,7 @@ class _LiveCareHistoryCardState extends State {
color: Colors.green,
),
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
- child: Text(widget.erRequestHistoryList.stringCallStatus,
- style: TextStyle(fontSize: 14.0, color: Colors.white)),
+ child: Text(widget.erRequestHistoryList.stringCallStatus, style: TextStyle(fontSize: 14.0, color: Colors.white)),
),
Divider(
color: Colors.grey[500],
@@ -90,17 +86,15 @@ class _LiveCareHistoryCardState extends State {
Expanded(
child: InkWell(
onTap: () {
- print("Invoice");
openInvoice();
},
child: Container(
child: Row(
children: [
- Icon(Icons.content_paste, color: Colors.blue),
+ Icon(Icons.content_paste, color: Colors.red),
Container(
margin: EdgeInsets.only(left: 10.0),
- child: Text("Invoice",
- textAlign: TextAlign.center),
+ child: Text(TranslationBase.of(context).invoice, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
),
],
),
@@ -110,7 +104,6 @@ class _LiveCareHistoryCardState extends State {
Expanded(
child: InkWell(
onTap: () {
- print("Complaints");
openComplaint();
},
child: Container(
@@ -119,8 +112,7 @@ class _LiveCareHistoryCardState extends State {
Icon(Icons.add, size: 24.0, color: Colors.red),
Container(
margin: EdgeInsets.only(left: 10.0),
- child: Text("Complaints",
- textAlign: TextAlign.center),
+ child: Text(TranslationBase.of(context).complaint, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
),
],
),
@@ -130,19 +122,16 @@ class _LiveCareHistoryCardState extends State {
Expanded(
child: InkWell(
onTap: () {
- print("Rate Dr & Appointment");
+ rateLiveCareAppo();
},
child: Container(
child: Row(
children: [
- Icon(Icons.star,
- size: 24.0, color: Colors.yellow[700]),
+ Icon(Icons.star, size: 24.0, color: Colors.yellow[700]),
Container(
width: MediaQuery.of(context).size.width * 0.2,
margin: EdgeInsets.only(left: 10.0),
- child: Text("Rate Dr & Appointment",
- overflow: TextOverflow.clip,
- textAlign: TextAlign.center),
+ child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
),
],
),
@@ -159,16 +148,25 @@ class _LiveCareHistoryCardState extends State {
);
}
+
+ rateLiveCareAppo() {
+ if(widget.erRequestHistoryList.isAppointmentHaveRating) {
+ AppToast.showErrorToast(message: TranslationBase.of(context).alreadyRated);
+ } else {
+
+ }
+ }
+
openInvoice() {
- ConfirmDialog dialog = new ConfirmDialog(
- context: context,
- confirmMessage: "Send a copy of this invoice to the email: " +
- authUser.emailAddress,
- okText: TranslationBase.of(context).confirm,
- cancelText: TranslationBase.of(context).cancel_nocaps,
- okFunction: () => {sendInvoiceEmail(context)},
- cancelFunction: () => {});
- dialog.showAlertDialog(context);
+ showDialog(
+ context: context,
+ child: ConfirmSendEmailDialog(
+ email: projectViewModel.user.emailAddress,
+ onTapSendEmail: () {
+ sendInvoiceEmail(context);
+ },
+ ),
+ );
}
openComplaint() {
@@ -176,17 +174,10 @@ class _LiveCareHistoryCardState extends State {
}
sendInvoiceEmail(context) {
- ConfirmDialog.closeAlertDialog(context);
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
- service
- .sendLiveCareInvoiceEmail(
- widget.erRequestHistoryList.appointmentNo.toString(),
- widget.erRequestHistoryList.projectID,
- authUser.emailAddress,
- context)
- .then((res) {
- AppToast.showSuccessToast(message: "LiveCare invoice sent successfully");
+ service.sendLiveCareInvoiceEmail(widget.erRequestHistoryList.appointmentNo.toString(), widget.erRequestHistoryList.projectID, authUser.emailAddress, context).then((res) {
+ AppToast.showSuccessToast(message: TranslationBase(context).emailSentSuccessfully);
}).catchError((err) {
AppToast.showErrorToast(message: err);
print(err);
@@ -195,8 +186,7 @@ class _LiveCareHistoryCardState extends State {
getAuthenticatedUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
- var data = AuthenticatedUser.fromJson(
- await this.sharedPref.getObject(USER_PROFILE));
+ var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
setState(() {
authUser = data;
});
diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart
index b9a783b3..c9b4fec2 100644
--- a/lib/pages/livecare/widgets/clinic_list.dart
+++ b/lib/pages/livecare/widgets/clinic_list.dart
@@ -78,6 +78,9 @@ class _clinic_listState extends State {
print("LiveCare Type Selected");
setState(() {
currentSelectedLiveCareType = "immediate";
+ // isDataLoaded = true;
+ // print(liveCareOnlineClinicsListResponse.length);
+ getLiveCareClinicsList();
});
}
});
@@ -556,7 +559,7 @@ class _clinic_listState extends State {
alignment: FractionalOffset.bottomCenter,
child: Container(
color: Colors.grey[100],
- transform: Matrix4.translationValues(0.0, -40.0, 0.0),
+ transform: Matrix4.translationValues(0.0, -65.0, 0.0),
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 20.0),
diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart
index 5b7eb6b8..2cef4da2 100644
--- a/lib/pages/login/confirm-login.dart
+++ b/lib/pages/login/confirm-login.dart
@@ -391,13 +391,14 @@ class _ConfirmLogin extends State {
}
loginWithFingurePrintFace(type, int isActive) async {
- if (isActive == 1) {
- // this.startBiometricLoginIfAvailable();
+ if (isActive == 1 || isActive ==0) {
+
const iosStrings =
const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID');
try {
authenticated = await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings);
+
} on PlatformException catch (e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: 'Please enable your Touch or Face ID');
@@ -645,7 +646,7 @@ class _ConfirmLogin extends State {
}
Widget _loginOptionButton(String _title, String _icon, int _flag, int _loginIndex) {
- bool isDisable = (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face));
+ bool isDisable = (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) || _flag == 2 && !checkIfBiometricAvailable(BiometricType.fingerprint));
return InkWell(
onTap: isDisable
diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart
index c7997647..28e1c1a9 100644
--- a/lib/pages/medical/doctor/doctor_home_page.dart
+++ b/lib/pages/medical/doctor/doctor_home_page.dart
@@ -80,7 +80,7 @@ class DoctorHomePage extends StatelessWidget {
nationalityFlagURL: _doctorList.nationalityFlagURL);
return DoctorView(
doctor: doctorList,
- isLiveCareAppointment: false,
+ isLiveCareAppointment: _doctorList.isLiveCareClinic,
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
diff --git a/lib/pages/medical/labs/passport_update_page.dart b/lib/pages/medical/labs/passport_update_page.dart
index ad77320f..51efda3a 100644
--- a/lib/pages/medical/labs/passport_update_page.dart
+++ b/lib/pages/medical/labs/passport_update_page.dart
@@ -1,11 +1,15 @@
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
+import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
+import 'package:provider/provider.dart';
class PassportUpdatePage extends StatefulWidget {
@override
@@ -15,6 +19,7 @@ class PassportUpdatePage extends StatefulWidget {
class _PassportUpdatePageState extends State {
TextEditingController passportNumber = new TextEditingController();
bool _isButtonDisabled;
+ ProjectViewModel projectViewModel;
@override
void initState() {
@@ -24,60 +29,224 @@ class _PassportUpdatePageState extends State {
@override
Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).passportNumber,
isShowAppBar: true,
isBottomBar: true,
showNewAppBar: true,
- showNewAppBarTitle: true,
+ showNewAppBarTitle: true,backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container(
- child: SingleChildScrollView(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Container(
- margin: EdgeInsets.all(45.0),
- child: Text(TranslationBase.of(context).enterPassportNumber, textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, color: Colors.black)),
+ child: Column(
+ children: [
+ Expanded(
+ child: SingleChildScrollView(
+ child: Padding(
+ padding: const EdgeInsets.all(12.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ width: double.infinity,
+ child: Card(
+ shape: cardRadius(12),
+ margin: EdgeInsets.zero,
+ child: Padding(
+ padding: const EdgeInsets.all(12.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ TranslationBase.of(context).covidBookAppo,
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 16,
+ letterSpacing: -0.64,
+ ),
+ ),
+ mHeight(6),
+ Row(
+ children: [
+ Text(
+ TranslationBase.of(context).patientName + ":",
+ style: TextStyle(
+ fontWeight: FontWeight.w600,
+ fontSize: 10,
+ letterSpacing: -0.6,
+ color: CustomColors.grey,
+ ),
+ ),
+ mWidth(3),
+ Text(
+ projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
+ style: TextStyle(
+ fontWeight: FontWeight.w600,
+ fontSize: 12,
+ letterSpacing: -0.48,
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Text(
+ TranslationBase.of(context).fileNo + ":",
+ style: TextStyle(
+ fontWeight: FontWeight.w600,
+ fontSize: 10,
+ letterSpacing: -0.6,
+ color: CustomColors.grey,
+ ),
+ ),
+ mWidth(3),
+ Text(
+ projectViewModel.user.patientIdentificationNo,
+ style: TextStyle(
+ fontWeight: FontWeight.w600,
+ fontSize: 12,
+ letterSpacing: -0.48,
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ mHeight(40),
+ SvgPicture.asset("assets/images/new/passport.svg", width: 40.0, fit: BoxFit.fill),
+ mHeight(12),
+ Text(
+ TranslationBase.of(context).enterPassportNumber,
+ textAlign: TextAlign.start,
+ style: TextStyle(
+ fontSize: 16.0,
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ letterSpacing: -0.64,
+ ),
+ ),
+ mHeight(8),
+ inputWidget(TranslationBase.of(context).passportNumber, "", passportNumber),
+ ],
+ ),
+ ),
),
- Container(
- margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
- child: SvgPicture.asset("assets/images/new-design/passport.svg", width: 250.0, fit: BoxFit.fill),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0, bottom: 10.0),
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ minWidth: MediaQuery.of(context).size.width,
+ height: 45.0,
+ child: RaisedButton(
+ color: new Color(0xFFc5272d),
+ textColor: Colors.white,
+ disabledTextColor: Colors.white,
+ elevation: 0,
+ disabledColor: Colors.red[300],
+ onPressed: () {
+ if (_isButtonDisabled == false)
+ updatePassportNumber();
+ else
+ AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber);
+ },
+ child: Text(
+ TranslationBase.of(context).submit,
+ style: TextStyle(
+ fontSize: 16.0,
+ letterSpacing: -0.64,
+ ),
+ ),
+ ),
),
- Container(
- margin: EdgeInsets.only(left: 50.0, right: 50.0, top: 25.0),
- child: TextFields(
- keyboardType: TextInputType.text,
- fontWeight: FontWeight.normal,
- controller: passportNumber,
- onChanged: (value) => {_onPassportTextChanged(value)},
- padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
- hintText: TranslationBase.of(context).passportNumber,
- )),
- Container(
- margin: EdgeInsets.only(top: 30.0, left: 45.0, right: 45.0, bottom: 10.0),
- child: ButtonTheme(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
+ return Container(
+ padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
+ alignment: Alignment.center,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(15),
+ color: Colors.white,
+ border: Border.all(
+ color: Color(0xffefefef),
+ width: 1,
+ ),
+ ),
+ child: InkWell(
+ onTap: hasSelection ? () {} : null,
+ child: Row(
+ children: [
+ Expanded(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ _labelText,
+ style: TextStyle(
+ fontSize: 11,
+ fontWeight: FontWeight.w600,
+ color: Color(0xff2B353E),
+ letterSpacing: -0.44,
+ ),
),
- minWidth: MediaQuery.of(context).size.width,
- height: 45.0,
- child: RaisedButton(
- color: new Color(0xFFc5272d),
- textColor: Colors.white,
- disabledTextColor: Colors.white,
- disabledColor: Colors.red[300],
- onPressed: () {
- if (_isButtonDisabled == false)
- updatePassportNumber();
- else
- AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber);
- },
- child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)),
+ TextField(
+ enabled: isEnable,
+ scrollPadding: EdgeInsets.zero,
+ keyboardType: TextInputType.number,
+ controller: _controller,
+ onChanged: (value) => {_onPassportTextChanged(value)},
+ style: TextStyle(
+ fontSize: 14,
+ height: 21 / 14,
+ fontWeight: FontWeight.w400,
+ color: Color(0xff2B353E),
+ letterSpacing: -0.44,
+ ),
+ decoration: InputDecoration(
+ isDense: true,
+ hintText: _hintText,
+ hintStyle: TextStyle(
+ fontSize: 14,
+ height: 21 / 14,
+ fontWeight: FontWeight.w400,
+ color: Color(0xff575757),
+ letterSpacing: -0.56,
+ ),
+ prefixIconConstraints: BoxConstraints(minWidth: 50),
+ prefixIcon: prefix == null
+ ? null
+ : Text(
+ "+" + prefix,
+ style: TextStyle(
+ fontSize: 14,
+ height: 21 / 14,
+ fontWeight: FontWeight.w500,
+ color: Color(0xff2E303A),
+ letterSpacing: -0.56,
+ ),
+ ),
+ contentPadding: EdgeInsets.zero,
+ border: InputBorder.none,
+ focusedBorder: InputBorder.none,
+ enabledBorder: InputBorder.none,
+ ),
),
- ),
+ ],
),
- ],
- ),
+ ),
+ if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
+ ],
),
),
);
@@ -116,7 +285,7 @@ class _PassportUpdatePageState extends State {
GifLoaderDialogUtils.hideDialog(context);
print(res['Covid19_Certificate_GetPassportList'][0]['PassportNo']);
passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'];
- if(res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
+ if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
_isButtonDisabled = false;
}
}).catchError((err) {
diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart
index 4b71b0b7..f75cc59f 100644
--- a/lib/pages/vaccine/my_vaccines_screen.dart
+++ b/lib/pages/vaccine/my_vaccines_screen.dart
@@ -5,7 +5,8 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
-import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
+import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
+import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@@ -30,12 +31,13 @@ class _MyVaccinesState extends State {
onModelReady: (model) => model.getVaccine(),
builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold(
isShowAppBar: true,
+ showNewAppBar: true,
+ showNewAppBarTitle: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).myVaccines,
description: TranslationBase.of(context).infoVaccines,
imagesInfo: [
- ImagesInfo(
- imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vacceines/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vacceines/ar/0.png')
+ ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vacceines/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vacceines/ar/0.png')
],
body: Container(
margin: EdgeInsets.only(
@@ -167,17 +169,41 @@ class _MyVaccinesState extends State {
if (projectViewModel.havePrivilege(27))
Container(
width: double.infinity,
- // height: 80.0,
- child: SecondaryButton(
- label: TranslationBase.of(context).sendEmail,
- color: Color(0xffF62426),
- textColor: Colors.white,
- disabled: model.vaccineList.length == 0,
- loading: model.state == ViewState.BusyLocal,
- onTap: () async {
- model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully);
+ child: DefaultButton(
+ TranslationBase.of(context).sendEmail,
+ () {
+ showDialog(
+ context: context,
+ child: ConfirmSendEmailDialog(
+ email: projectViewModel.user.emailAddress,
+ onTapSendEmail: () {
+ model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully);
+ },
+ ),
+ );
},
),
+
+ // SecondaryButton(
+ // label: TranslationBase.of(context).sendEmail,
+ // color: Color(0xffF62426),
+ // textColor: Colors.white,
+ // disabled: model.vaccineList.length == 0,
+ // loading: model.state == ViewState.BusyLocal,
+ // onTap: () async {
+ // showDialog(
+ // context: context,
+ // child: ConfirmSendEmailDialog(
+ // email: projectViewModel.user.emailAddress,
+ // onTapSendEmail: () {
+ // // generateCovidCertificate(context, isOutsideKSA);
+ // model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully);
+ // },
+ // ),
+ // );
+ // // model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully);
+ // },
+ // ),
),
],
),
diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart
index e7e19f4d..1c11e26b 100644
--- a/lib/services/appointment_services/GetDoctorsList.dart
+++ b/lib/services/appointment_services/GetDoctorsList.dart
@@ -15,7 +15,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
-
class DoctorsListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
@@ -28,25 +27,20 @@ class DoctorsListService extends BaseService {
String deviceToken;
String tokenID;
- Future