Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan_new_design

merge-requests/400/head
Sultan Khan 3 years ago
commit fc9f2fc34e

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="12.05" height="12.054" viewBox="0 0 12.05 12.054">
<g id="Page-1" transform="translate(-0.006 0.002)">
<g id="_029---Lane-Split" data-name="029---Lane-Split" transform="translate(0.006 -0.002)">
<path id="Shape" d="M2.532,1.083.044,4.622a.205.205,0,0,0,.168.324H1.46V5.57A5.366,5.366,0,0,0,3.293,9.61l.511.447a2.876,2.876,0,0,1,.981,2.163v.623a.208.208,0,0,0,.208.208H7.07a.208.208,0,0,0,.208-.208V12.22A5.4,5.4,0,0,0,5.445,8.18l-.511-.447A2.876,2.876,0,0,1,3.953,5.57V4.946H5.2a.205.205,0,0,0,.168-.324l-2.5-3.539a.208.208,0,0,0-.337,0Z" transform="translate(-0.006 -0.998)" fill="#2e303a"/>
<path id="Shape-2" data-name="Shape" d="M30.693,4.741a.207.207,0,0,0,.208.206h1.247V5.57a2.876,2.876,0,0,1-.981,2.163l-.511.447c-.106.094-.208.191-.305.291.012.017.027.031.039.048A5.758,5.758,0,0,1,31.6,10.983a2.842,2.842,0,0,1,.7-.927l.511-.447a5.366,5.366,0,0,0,1.833-4.04V4.946h1.247a.205.205,0,0,0,.168-.324l-2.5-3.539a.208.208,0,0,0-.337,0L30.732,4.622a.2.2,0,0,0-.039.118Z" transform="translate(-24.044 -0.998)" fill="#2e303a"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="40.337" height="48.98" viewBox="0 0 40.337 48.98">
<g id="passport" transform="translate(-45)">
<path id="Path_4990" data-name="Path 4990" d="M417.4.094a7.655,7.655,0,0,1,1.69,4.8V44.253a7.655,7.655,0,0,1-1.69,4.8,4.858,4.858,0,0,0,4.571-4.839V4.933A4.858,4.858,0,0,0,417.4.094Z" transform="translate(-336.636 -0.085)" fill="#2e303a"/>
<g id="Group_8308" data-name="Group 8308" transform="translate(45 0)">
<path id="Path_4991" data-name="Path 4991" d="M200.443,195a18.068,18.068,0,0,0,.988,5.177c.589,1.546,1.21,2.026,1.37,2.026s.781-.48,1.37-2.026A18.065,18.065,0,0,0,205.16,195Z" transform="translate(-185.514 -176.272)" fill="#2e303a"/>
<path id="Path_4992" data-name="Path 4992" d="M202.8,90c-.16,0-.781.48-1.37,2.026a18.064,18.064,0,0,0-.988,5.177h4.717a18.069,18.069,0,0,0-.988-5.177C203.583,90.48,202.961,90,202.8,90Z" transform="translate(-185.514 -81.356)" fill="#2e303a"/>
<path id="Path_4993" data-name="Path 4993" d="M268.551,106.8h3.279a8.668,8.668,0,0,0-4.453-6.183A20.911,20.911,0,0,1,268.551,106.8Z" transform="translate(-246.02 -90.957)" fill="#2e303a"/>
<path id="Path_4994" data-name="Path 4994" d="M139.536,106.8a20.91,20.91,0,0,1,1.174-6.183,8.668,8.668,0,0,0-4.453,6.183Z" transform="translate(-127.493 -90.957)" fill="#2e303a"/>
<path id="Path_4995" data-name="Path 4995" d="M74.661,0H45V48.98H74.661a4.887,4.887,0,0,0,4.914-4.848V4.848A4.887,4.887,0,0,0,74.661,0ZM66.609,41.777H57.965V38.9h8.644Zm2.881-5.762H55.084V33.134H69.49Zm-7.2-7.2A11.525,11.525,0,1,1,73.812,17.287,11.538,11.538,0,0,1,62.287,28.812Z" transform="translate(-45 0)" fill="#2e303a"/>
<path id="Path_4996" data-name="Path 4996" d="M268.551,195a20.911,20.911,0,0,1-1.174,6.183A8.668,8.668,0,0,0,271.83,195Z" transform="translate(-246.02 -176.272)" fill="#2e303a"/>
<path id="Path_4997" data-name="Path 4997" d="M139.536,195h-3.279a8.668,8.668,0,0,0,4.453,6.183A20.91,20.91,0,0,1,139.536,195Z" transform="translate(-127.493 -176.272)" fill="#2e303a"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -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": "تم تقييم هذا الموعد مسبقاً" },
};

@ -45,7 +45,7 @@ class PrescriptionsOrder {
return '$status';
}
String getFormattedDateTime()=> DateUtil.getDateFormatted(pickupDateTime);
String getFormattedDateTime()=> DateUtil.getWeekDayMonthDayYearDateFormatted(createdOn, isAppArabic ? 'ar' : 'en');
PrescriptionsOrder(
{this.iD,

@ -12,7 +12,6 @@ class ActiveMedicationsService extends BaseService{
Map<String, dynamic> 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();

@ -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");
});

@ -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;

@ -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,

@ -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<NewCMCStepOnePage> {
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: <Widget>[
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);
}
}
},
),
}
},
),
],
),
),
],
),
);
}

@ -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<CMCPage> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<CMCViewModel>(
onModelReady: (model) async {
await model.getCmcAllPresOrders();
@ -47,61 +50,35 @@ class _CMCPageState extends State<CMCPage> with SingleTickerProviderStateMixin {
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column(
children: <Widget>[
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: <Widget>[
NewCMCPage(
model: model,
),
OrdersLogDetailsPage(
model: model,
)
],
children: <Widget>[NewCMCPage(model: model), OrdersLogDetailsPage(model: model)],
),
)
],

@ -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),
);
}
}

@ -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<NewHomeHealthCareStepOneP
return AppScaffold(
isShowAppBar: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.05, right: MediaQuery.of(context).size.width * 0.05),
child: Center(
child: FractionallySizedBox(
widthFactor: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Texts(
// TranslationBase.of(context).selectHomeHealthCareServices,
// textAlign: TextAlign.center,
// ),
Column(
children: widget.model.hhcAllServicesList.map((service) {
return Container(
margin: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
// border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
body: Column(
children: [
Expanded(
child: ListView.separated(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12),
itemBuilder: (context, index) {
HHCGetAllServicesResponseModel service = widget.model.hhcAllServicesList[index];
return Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Row(
children: [
Checkbox(
value: isServiceSelected(service.serviceID),
activeColor: Color(0xffD02127),
tristate: false,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onChanged: (bool newValue) {
setState(() {
if (!isServiceSelected(service.serviceID))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList(
recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length, serviceID: service.serviceID, serviceName: service.description));
else
removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel
// isPatientInsured = newValue;
});
}),
SizedBox(width: 6),
Expanded(
child: Text(
projectViewModel.isArabic ? service.descriptionN : service.description.toLowerCase()?.capitalize(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
),
),
child: Column(
children: [
Row(
children: [
Checkbox(
value: isServiceSelected(service.serviceID),
activeColor: Colors.red[800],
tristate: false,
onChanged: (bool newValue) {
setState(() {
if (!isServiceSelected(service.serviceID))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList(
recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length,
serviceID: service.serviceID,
serviceName: service.description));
else
removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel
// isPatientInsured = newValue;
});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.only(left: 0.0, right: 10),
child: Texts(
projectViewModel.isArabic ? service.descriptionN : service.description.toLowerCase()?.capitalize(),
fontSize: 15,
style: 'letterSpacing: -0.48',
fontWeight: FontWeight.bold,
),
),
),
],
],
),
);
},
separatorBuilder: (context, index) => 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,
),
],
),
);
}

@ -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<NewHomeHealthCarePage> 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<NewHomeHealthCarePage> 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(

@ -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<HomeHealthCarePage> with SingleTick
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) {
model.getHHCAllPresOrders();
@ -45,67 +48,44 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage> 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: <Widget>[
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: <Widget>[
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: <Widget>[
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
NewHomeHealthCarePage(
model: model,
),
OrdersLogDetailsPage(
model: model,
)
],
),
)
],
),
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
NewHomeHealthCarePage(
model: model,
),
OrdersLogDetailsPage(
model: model,
)
],
),
)
],
),
),
);

@ -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),
);
}
}

@ -480,7 +480,11 @@ class _BookSuccessState extends State<BookSuccess> {
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);
}

@ -171,7 +171,7 @@ class _DoctorProfileState extends State<DoctorProfile> 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,

@ -358,6 +358,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
});
} else {
DocAvailableAppointments.areAppointmentsAvailable = false;
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);

@ -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<CovidTimeSlots> with TickerProviderStat
ScrollController _scrollController;
ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider;
@override
void initState() {
@ -119,203 +120,211 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
ProjectViewModel projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(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: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
_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: <Widget>[
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 = <Widget>[];
if (events.isNotEmpty) {
children.add(
Positioned(
right: 4,
bottom: 4,
child: _buildEventsMarker(date, events),
),
);
}
),
),
);
},
markersBuilder: (context, date, events, holidays) {
final children = <Widget>[];
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<CovidTimeSlots> 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<CovidTimeSlots> 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<CovidTimeSlots> 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<CovidTimeSlots> 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<CovidTimeSlots> 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<CovidTimeSlots> 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<CovidTimeSlots> 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);
});
}

@ -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<CovidDirveThruQuestions> {
List qa;
ProjectViewModel projectViewModel;
@override
void initState() {
@ -37,91 +37,212 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
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<int>(
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<int>(
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<int>(
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<int>(
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<CovidDirveThruQuestions> {
getPaymentInfo(context, widget.projectId);
}
else
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseSelectAllQuestionToContinue);
AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue);
}
openPassportUpdatePage() {

@ -67,7 +67,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
isShowDecPage: true,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column(
children: [
Expanded(
@ -113,7 +113,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
),
),
Container(
height: 18,
height: 20,
child: DropdownButtonHideUnderline(
child: DropdownButton<DriveThroughTestingCenterModel>(
onTap: () {
@ -185,10 +185,13 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
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<CovidDrivethruLocation> {
),
),
),
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<CovidDrivethruLocation> {
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));

@ -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<CovidPaymentAlert> {
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
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<CovidPaymentAlert> {
],
),
),
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: <Widget>[
// 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<CovidPaymentAlert> {
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) {

@ -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<CovidPaymentDetails> {
@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: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
// 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: <Widget>[
// 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<CovidPaymentDetails> {
});
},
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<CovidPaymentDetails> {
],
),
),
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: <Widget>[
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<CovidPaymentDetails> {
});
}
_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,
),
);
}
}

@ -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<CovidPaymentSummary> {
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<CovidPaymentSummary> {
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<CovidPaymentSummary> {
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<CovidPaymentSummary> {
);
}
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;

@ -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),
),
);
}

@ -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');
}

@ -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<RRTRequestPage> {
bool acceptTerms = false;
TranslationBase localize;
RRTViewModel viewModel;
@override
Widget build(BuildContext context) {
localize = TranslationBase.of(context);
return BaseView<RRTViewModel>(
onModelReady: (vm) {
viewModel = vm;
@ -63,7 +60,8 @@ class RRTRequestPageState extends State<RRTRequestPage> {
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<RRTRequestPage> {
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<RRTRequestPage> {
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<RRTRequestPage> {
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<RRTRequestPage> {
if (acceptTerms)
goToPickupAddress();
else
AppToast.showErrorToast(message: localize.pleaseAcceptTerms);
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
},
),
),

@ -107,7 +107,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> 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<AppointmentDetails> 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<AppointmentDetails> 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)),
)

@ -121,7 +121,8 @@ class _ToDoState extends State<ToDo> {
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<ToDo> {
});
}
Navigator.push(context, FadePage(page: PaymentMethod())).then((value) {
Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd) {
setState(() {});
}))).then((value) {
print(value);
getPatientAppointmentHistory();

@ -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<PaymentMethod> {
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<PaymentMethod> {
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: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
// 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<PaymentMethod> {
),
),
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<PaymentMethod> {
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(),

@ -79,7 +79,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
padding: const EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6),
child: InkWell(
onTap: () {
navigateTo(context, MedicalProfilePageNew());
widget.onMedicalFileClick();
},
child: LoggedSliderView(
projectViewModel,

@ -233,13 +233,14 @@ class _LandingPageState extends State<LandingPage> 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

@ -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<LiveCareHome> with SingleTickerProviderSt
ErRequestHistoryList pendingERRequestHistoryList;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
ProjectViewModel projectViewModel;
@override
void initState() {
@ -39,9 +41,9 @@ class _LiveCareHomeState extends State<LiveCareHome> 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<LiveCareHome> with SingleTickerProviderSt
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).livecare,
isShowAppBar: true,

@ -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<LiveCareHistoryCard> {
AuthenticatedUser authUser = new AuthenticatedUser();
AppSharedPreferences sharedPref = AppSharedPreferences();
ProjectViewModel projectViewModel;
@override
void initState() {
getAuthenticatedUser();
@ -32,6 +37,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
@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<LiveCareHistoryCard> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
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: <Widget>[
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<LiveCareHistoryCard> {
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<LiveCareHistoryCard> {
Expanded(
child: InkWell(
onTap: () {
print("Invoice");
openInvoice();
},
child: Container(
child: Row(
children: <Widget>[
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<LiveCareHistoryCard> {
Expanded(
child: InkWell(
onTap: () {
print("Complaints");
openComplaint();
},
child: Container(
@ -119,8 +112,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
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<LiveCareHistoryCard> {
Expanded(
child: InkWell(
onTap: () {
print("Rate Dr & Appointment");
rateLiveCareAppo();
},
child: Container(
child: Row(
children: <Widget>[
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<LiveCareHistoryCard> {
);
}
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<LiveCareHistoryCard> {
}
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<LiveCareHistoryCard> {
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;
});

@ -78,6 +78,9 @@ class _clinic_listState extends State<ClinicList> {
print("LiveCare Type Selected");
setState(() {
currentSelectedLiveCareType = "immediate";
// isDataLoaded = true;
// print(liveCareOnlineClinicsListResponse.length);
getLiveCareClinicsList();
});
}
});
@ -556,7 +559,7 @@ class _clinic_listState extends State<ClinicList> {
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),

@ -391,13 +391,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
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<ConfirmLogin> {
}
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

@ -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),

@ -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<PassportUpdatePage> {
TextEditingController passportNumber = new TextEditingController();
bool _isButtonDisabled;
ProjectViewModel projectViewModel;
@override
void initState() {
@ -24,60 +29,224 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
@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<PassportUpdatePage> {
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) {

@ -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<MyVaccines> {
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<MyVaccines> {
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);
// },
// ),
),
],
),

File diff suppressed because it is too large Load Diff

@ -18,31 +18,15 @@ class CovidDriveThruService extends BaseService {
Map<String, dynamic> request;
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));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authUser.outSA,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"License": true
};
request = {};
dynamic localRes;
await baseAppClient.post(GET_COVID_DRIVETHRU_PROJECT_LIST,
onSuccess: (response, statusCode) async {
await baseAppClient.post(GET_COVID_DRIVETHRU_PROJECT_LIST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
@ -54,35 +38,18 @@ class CovidDriveThruService extends BaseService {
Map<String, dynamic> request;
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));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authUser.outSA,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"License": true
};
request = {};
dynamic localRes;
await baseAppClient.post(GET_COVID_DRIVETHRU_PROCEDURES_LIST,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
await baseAppClient.post(GET_COVID_DRIVETHRU_PROCEDURES_LIST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
@ -90,37 +57,22 @@ class CovidDriveThruService extends BaseService {
Map<String, dynamic> request;
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));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"ProjectID": projectID,
"ProcedureId": procedureID,
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authUser.outSA,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"License": true
"ProcedureId": procedureID
};
dynamic localRes;
await baseAppClient.post(GET_COVID_DRIVETHRU_PAYMENT_INFO,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
await baseAppClient.post(GET_COVID_DRIVETHRU_PAYMENT_INFO, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
@ -128,36 +80,21 @@ class CovidDriveThruService extends BaseService {
Map<String, dynamic> request;
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));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"ProjectID": projectID,
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authUser.outSA,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"License": true
};
dynamic localRes;
await baseAppClient.post(GET_COVID_DRIVETHRU_FREE_SLOTS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
await baseAppClient.post(GET_COVID_DRIVETHRU_FREE_SLOTS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -125,15 +125,16 @@ class LiveCareService extends BaseService {
Future<Map> getLivecareHistory(BuildContext context) async {
Map<String, dynamic> request;
request = {};
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
// var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
// Request req = appGlobal.getPublicRequest();
request = {"LanguageID": languageID == 'ar' ? 1 : 2, "TokenID": "", "SessionID": "YckwoXhUmWBsnHKEKig"};
// request = {"LanguageID": languageID == 'ar' ? 1 : 2, "TokenID": "", "SessionID": "YckwoXhUmWBsnHKEKig"};
dynamic localRes;

@ -69,7 +69,9 @@ class TranslationBase {
String get enterDocName => localizedValues['enterDocName'][locale.languageCode];
String get search => localizedValues['search'][locale.languageCode];
String get noResultFound => localizedValues['noResultFound'][locale.languageCode];
String get pleaseEnterProductName => localizedValues['pleaseEnterProductName'][locale.languageCode];
String get bookNow => localizedValues['bookNow'][locale.languageCode];
@ -415,7 +417,9 @@ class TranslationBase {
String get sendEmail => localizedValues['sendEmail'][locale.languageCode];
String get close => localizedValues['close'][locale.languageCode];
String get closeIt => localizedValues['closeIt'][locale.languageCode];
String get booked => localizedValues['booked'][locale.languageCode];
String get confirmed => localizedValues['confirmed'][locale.languageCode];
@ -754,6 +758,10 @@ class TranslationBase {
String get save => localizedValues['Save'][locale.languageCode];
String get agreeTo => localizedValues['agreeTo'][locale.languageCode];
String get termsConditoins => localizedValues['termsConditoins'][locale.languageCode];
String get userAgreement => localizedValues['UserAgreement'][locale.languageCode];
String get updateSuccessfully => localizedValues['UpdateSuccessfully'][locale.languageCode];
@ -810,6 +818,8 @@ class TranslationBase {
String get confirmThePayment => localizedValues['ConfirmThePayment'][locale.languageCode];
String get changePayment => localizedValues['changePayment'][locale.languageCode];
String get depositorName => localizedValues['DepositorName'][locale.languageCode];
String get mobileNumber => localizedValues['MobileNumber'][locale.languageCode];
@ -907,16 +917,27 @@ class TranslationBase {
String get lakum => localizedValues['lakum'][locale.languageCode];
String get wishlist => localizedValues['wishlist'][locale.languageCode];
String get brands => localizedValues['brands'][locale.languageCode];
String get products => localizedValues['products'][locale.languageCode];
String get reviews => localizedValues['reviews'][locale.languageCode];
String get productDetails => localizedValues['productDetails'][locale.languageCode];
String get noReviewsAvailable => localizedValues['noReviewsAvailable'][locale.languageCode];
String get noLocationAvailable => localizedValues['noLocationAvailable'][locale.languageCode];
String get myPrescriptions => localizedValues['myPrescriptions'][locale.languageCode];
String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode];
String get pillReminder => localizedValues['pillReminder'][locale.languageCode];
String get shippingAddresses => localizedValues['shippingAddresses'][locale.languageCode];
String get reachUs => localizedValues['reachUs'][locale.languageCode];
String get ourLocations => localizedValues['ourLocations'][locale.languageCode];
@ -1133,10 +1154,15 @@ class TranslationBase {
String get yearOld => localizedValues['years-old'][locale.languageCode];
String get categorise => localizedValues['categorise'][locale.languageCode];
String get refine => localizedValues['refine'][locale.languageCode];
String get apply => localizedValues['apply'][locale.languageCode];
String get reset => localizedValues['reset'][locale.languageCode];
String get viewCategorise => localizedValues['viewCategorise'][locale.languageCode];
String get cart => localizedValues['cart'][locale.languageCode];
String get wishList => localizedValues['wishList'][locale.languageCode];
@ -1744,10 +1770,15 @@ class TranslationBase {
String get quantitySize => localizedValues['quantitySize'][locale.languageCode];
String get addToCart => localizedValues['addToCart'][locale.languageCode];
String get addToWishlist => localizedValues['addToWishlist'][locale.languageCode];
String get buyNow => localizedValues['buyNow'][locale.languageCode];
String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode];
String get noData => localizedValues['noData'][locale.languageCode];
String get no_data => localizedValues['no_data'][locale.languageCode];
String get year => localizedValues['Year'][locale.languageCode];
@ -2260,7 +2291,21 @@ class TranslationBase {
String get emptySchedule => localizedValues["emptySchedule"][locale.languageCode];
String get serviceNotAvailable => localizedValues["serviceNotAvailable"][locale.languageCode];
String get doctorScheduleNot => localizedValues["doctorScheduleNot"][locale.languageCode];
String get RRTRequestSuccess => localizedValues["RRTRequestSuccess"][locale.languageCode];
String get rateDoctorAppo => localizedValues["rateDoctorAppo"][locale.languageCode];
String get invoice => localizedValues["invoice"][locale.languageCode];
String get requestedDate => localizedValues["requestedDate"][locale.languageCode];
String get callDuration => localizedValues["callDuration"][locale.languageCode];
String get alreadyRated => localizedValues["alreadyRated"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -9,7 +9,6 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -37,7 +36,6 @@ import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -462,7 +460,9 @@ class Utils {
if (projectViewModel.isLogin && userData_ != null) {
String patientID = userData_.patientID.toString();
GifLoaderDialogUtils.showMyDialog(context);
projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)});
projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}).catchError((err) {
print(err.toString());
});
} else {
AlertDialogBox(
context: context,
@ -595,7 +595,6 @@ class Utils {
MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)),
));
return medical;
}
@ -632,11 +631,12 @@ class Utils {
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
),
SizedBox(height: 5),
if(showDivider) Divider(
height: 1,
color: Color(0xff2E303A),
thickness: 1,
)
if (showDivider)
Divider(
height: 1,
color: Color(0xff2E303A),
thickness: 1,
)
],
);
}

@ -0,0 +1,26 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
showDraggableDialog(BuildContext context, Widget child) {
showGeneralDialog(
barrierLabel: "Label",
barrierDismissible: false,
barrierColor: Colors.black.withOpacity(0.2),
transitionDuration: Duration(milliseconds: 200),
context: context,
pageBuilder: (context, anim1, anim2) {
return Dismissible(
direction: DismissDirection.vertical,
key: const Key('key'),
onDismissed: (_) => Navigator.of(context).pop(),
child: child,
);
},
transitionBuilder: (context, anim1, anim2, child) {
return SlideTransition(
position: Tween(begin: Offset(0, 1), end: Offset(0, 0)).animate(anim1),
child: child,
);
},
);
}

@ -122,7 +122,7 @@ class DoctorHeader extends StatelessWidget {
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
color: onRatingAndReviewTap != null ? Colors.blue[600] : Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12,
decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null,

@ -19,13 +19,13 @@ class AppExpandableNotifier extends StatefulWidget {
bool expandFlag = false;
var controller = new ExpandableController();
bool isTitleSingleLine;
AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false, this.isTitleSingleLine = true});
_AppExpandableNotifier createState() => _AppExpandableNotifier();
}
class _AppExpandableNotifier extends State<AppExpandableNotifier> {
ProjectViewModel projectViewModel;
@override
@ -43,8 +43,9 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
String _mainTitle = (widget.title ?? TranslationBase.of(context).details);
String _title = projectViewModel.isArabic ? _mainTitle.split(" ")[1] : _mainTitle.split(" ")[0];
String _mainTitle = (widget.title ?? TranslationBase.of(context).details).trim();
String _title = _mainTitle.contains(" ") ? (projectViewModel.isArabic ? (_mainTitle.split(" ").length < 1 ? _mainTitle : _mainTitle.split(" ")[1]) : _mainTitle.split(" ")[0]) : _mainTitle;
// String _title = _mainTitle.split(" ")[0];
String _subTitle = _mainTitle.replaceAll(_title, "").trim();
if (_subTitle.length < 1) {

Loading…
Cancel
Save