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

merge-update-with-lab-changes
Sultan Khan 5 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': 'تعليمات'}, 'instruction': {'en': 'Instructions', 'ar': 'تعليمات'},
'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'}, 'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'},
'livecareAppo': {'en': 'LiveCare Appointment', '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': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'}, '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-noAction': {'en': 'No Action Required', 'ar': 'لا يوجد إجراء مطلوب'},
'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', '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 ساعة."}, "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": "ملخص الطلب"}, "RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"},
"Rapid-Response-Team": {"en": "Rapid Response Team", "ar": "فريق الاستجابة السريع"}, "Rapid-Response-Team": {"en": "Rapid Response Team", "ar": "فريق الاستجابة السريع"},
"AmountBeforeTax": {"en": "Amount Before Tax:", "ar": "Amount Before Tax:"}, "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:"}, "TaxAmount": {"en": "Tax Amount:", "ar": "Tax Amount:"},
"somethingWentWrongTryLater": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا"}, "somethingWentWrongTryLater": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا"},
"TotalAmountPayable": {"en": "Total Amount Payable:", "ar": "Total Amount Payable:"}, "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:"}, "iAcceptTermsConditions": {"en": "I Accept the Terms And Conditions", "ar": "أوافق على الشروط والأحكام"},
"YouCanPayByTheFollowingOptions": {"en": "You can pay by the following options:", "ar": "I Accept the Terms And Conditions"}, "YouCanPayByTheFollowingOptions": {"en": "You can pay by the following Options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"},
"RRTDDetails": { "RRTDDetails": {
"en": "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.",
"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": "توفر خدمة فريق الاستجابة السريع RRT خدمه طبيه للحالات المستعجله والمستقره وليست الحالات المهدده للحياه او الاطراف ، وتشمل الخدمه تقديم رعايه طبيه من فريق طبي متكامل بالمنزل."
"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"
}, },
"rrtService": {"en": "RRT Service", "ar": "خدمة RRT"}, "rrtService": {"en": "RRT Service", "ar": "خدمة RRT"},
"bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"},
@ -1511,5 +1511,11 @@ const Map localizedValues = {
"covidBookAppo": { "en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: " }, "covidBookAppo": { "en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: " },
"emptySchedule": { "en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب" }, "emptySchedule": { "en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب" },
"serviceNotAvailable": { "en": "Dear, this service is not available now, please try again later", "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'; return '$status';
} }
String getFormattedDateTime()=> DateUtil.getDateFormatted(pickupDateTime); String getFormattedDateTime()=> DateUtil.getWeekDayMonthDayYearDateFormatted(createdOn, isAppArabic ? 'ar' : 'en');
PrescriptionsOrder( PrescriptionsOrder(
{this.iD, {this.iD,

@ -12,7 +12,6 @@ class ActiveMedicationsService extends BaseService{
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['PatientID'] = 1298851; body['PatientID'] = 1298851;
body['TokenID'] = "@dm!n";
await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID, await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
activePrescriptionReport.clear(); activePrescriptionReport.clear();

@ -44,6 +44,8 @@ class RRTViewModel extends BaseViewModel {
body['CreatedBy'] = user.patientIdentificationType; body['CreatedBy'] = user.patientIdentificationType;
body['OrderServiceID'] = 5; body['OrderServiceID'] = 5;
var localRes;
int requestNo; int requestNo;
await _service.baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, body: body, onSuccess: (response, statusCode) { await _service.baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, body: body, onSuccess: (response, statusCode) {
requestNo = response['RequestNo']; requestNo = response['RequestNo'];
@ -57,18 +59,20 @@ class RRTViewModel extends BaseViewModel {
Future<_RRTServiceData> getAllOrders() async { Future<_RRTServiceData> getAllOrders() async {
await _service.baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, body: {}, onSuccess: (response, statusCode) { await _service.baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, body: {}, onSuccess: (response, statusCode) {
var data = response["PatientER_GetPatientAllPresOrdersList"]; var data = response["PatientER_GetPatientAllPresOrdersList"];
rrtServiceData.completedOrders.clear();
rrtServiceData.pendingOrders.clear();
if (data != null && data is List) { if (data != null && data is List) {
data.forEach((json) { data.forEach((json) {
if (json["ServiceID"] == 5) { if (json["ServiceID"] == 5) {
if (json["Status"] == 1) { if (json["Status"] == 1 || json["Status"] == 2) {
// Pending // Pending
rrtServiceData.pendingOrders.clear();
rrtServiceData.pendingOrders.add(PrescriptionsOrder.fromJson(json)); 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"); return Future.error("404");
}); });

@ -21,6 +21,7 @@ class DoctorList {
bool isDoctorAllowVedioCall; bool isDoctorAllowVedioCall;
bool isDoctorDummy; bool isDoctorDummy;
bool isLiveCare; bool isLiveCare;
bool isLiveCareClinic;
bool isDoctorHasPrePostImages; bool isDoctorHasPrePostImages;
String latitude; String latitude;
String longitude; String longitude;
@ -63,6 +64,7 @@ class DoctorList {
this.isDoctorAllowVedioCall, this.isDoctorAllowVedioCall,
this.isDoctorDummy, this.isDoctorDummy,
this.isLiveCare, this.isLiveCare,
this.isLiveCareClinic,
this.isDoctorHasPrePostImages, this.isDoctorHasPrePostImages,
this.latitude, this.latitude,
this.longitude, this.longitude,
@ -105,6 +107,7 @@ class DoctorList {
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isDoctorDummy = json['IsDoctorDummy']; isDoctorDummy = json['IsDoctorDummy'];
isLiveCare = json['IsLiveCare']; isLiveCare = json['IsLiveCare'];
isLiveCareClinic = json['IsLiveCareClinic'];
isDoctorHasPrePostImages = json['IsDoctorHasPrePostImages']; isDoctorHasPrePostImages = json['IsDoctorHasPrePostImages'];
latitude = json['Latitude']; latitude = json['Latitude'];
longitude = json['Longitude']; longitude = json['Longitude'];
@ -150,6 +153,7 @@ class DoctorList {
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
data['IsDoctorDummy'] = this.isDoctorDummy; data['IsDoctorDummy'] = this.isDoctorDummy;
data['IsLiveCare'] = this.isLiveCare; data['IsLiveCare'] = this.isLiveCare;
data['IsLiveCareClinic'] = this.isLiveCareClinic;
data['IsDoctorHasPrePostImages'] = this.isDoctorHasPrePostImages; data['IsDoctorHasPrePostImages'] = this.isDoctorHasPrePostImages;
data['Latitude'] = this.latitude; data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude; data['Longitude'] = this.longitude;

@ -50,7 +50,7 @@ class ConfirmDialog extends StatelessWidget {
], ],
), ),
Text( Text(
"Request has been sent successfully. You will be contacted soon.", TranslationBase.of(context).RRTRequestSuccess,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
@ -60,7 +60,7 @@ class ConfirmDialog extends StatelessWidget {
), ),
mHeight(20), mHeight(20),
Text( Text(
"Request ID", TranslationBase.of(context).reqId,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, 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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -22,7 +23,7 @@ class NewCMCStepOnePage extends StatefulWidget {
final double latitude; final double latitude;
final double longitude; 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 @override
_NewCMCStepOnePageState createState() => _NewCMCStepOnePageState(); _NewCMCStepOnePageState createState() => _NewCMCStepOnePageState();
@ -41,160 +42,152 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: widget.model, baseViewModel: widget.model,
body: SingleChildScrollView( body: Column(
physics: ScrollPhysics(), children: [
child: Container( Expanded(
margin: EdgeInsets.only(left: 12, right: 12), child: SingleChildScrollView(
child: Center( physics: BouncingScrollPhysics(),
child: Column( padding: EdgeInsets.all(21),
children: [ child: Column(
ListView.separated( children: [
physics: NeverScrollableScrollPhysics(), ListView.separated(
shrinkWrap: true, physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { shrinkWrap: true,
return Row( itemBuilder: (context, index) {
children: [ return Row(
Radio( children: [
value: widget.model.cmcAllServicesList[index].serviceID, Radio(
activeColor: Colors.red[800], value: widget.model.cmcAllServicesList[index].serviceID,
onChanged: (newValue) async { activeColor: Colors.red[800],
PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( onChanged: (newValue) async {
price: widget.model.cmcAllServicesList[index].price, PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
serviceID: widget.model.cmcAllServicesList[index].serviceID.toString(), price: widget.model.cmcAllServicesList[index].price,
selectedServiceName: widget.model.cmcAllServicesList[index].description, serviceID: widget.model.cmcAllServicesList[index].serviceID.toString(),
selectedServiceNameAR: widget.model.cmcAllServicesList[index].descriptionN, selectedServiceName: widget.model.cmcAllServicesList[index].description,
recordID: 1, selectedServiceNameAR: widget.model.cmcAllServicesList[index].descriptionN,
totalPrice: widget.model.cmcAllServicesList[index].totalPrice, recordID: 1,
vAT: widget.model.cmcAllServicesList[index].vAT); totalPrice: widget.model.cmcAllServicesList[index].totalPrice,
setState(() { vAT: widget.model.cmcAllServicesList[index].vAT);
widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; setState(() {
}); widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList];
CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: newValue); });
await widget.model.getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel); 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) groupValue: widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length > 0
: 1), ? int.parse(widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList[0].serviceID)
Expanded( : 1),
child: Padding( Expanded(
padding: const EdgeInsets.only( child: Padding(
left: 10, padding: const EdgeInsets.only(
right: 10, left: 10,
top: 20, right: 10,
bottom: 20, 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,
), ),
), 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);
},
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,
), ),
), ),
); ),
}, ],
separatorBuilder: (context, index) { );
return mDivider(Colors.grey); },
}, separatorBuilder: (context, index) {
physics: NeverScrollableScrollPhysics(), return mDivider(Colors.grey);
shrinkWrap: true, },
itemCount: widget.model.checkupItems.length, 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(
mHeight(MediaQuery.of(context).size.height * 0.12), // 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,
// ),
// ],
// ),
// ),
// ),
],
),
), ),
), ),
), Container(
), color: Colors.white,
bottomSheet: Container( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
height: MediaQuery.of(context).size.height * 0.10, child: DefaultButton(
width: double.infinity, TranslationBase.of(context).next,
color: CustomColors.appBackgroudGreyColor, () async {
child: Column( if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length != 0 || widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList == null) {
crossAxisAlignment: CrossAxisAlignment.center, int index = widget.model.cmcAllServicesList.length;
mainAxisAlignment: MainAxisAlignment.center, PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
children: <Widget>[ price: widget.model.cmcAllServicesList[index - 1].price,
Container( serviceID: widget.model.cmcAllServicesList[index - 1].serviceID.toString(),
width: MediaQuery.of(context).size.width * 0.9, selectedServiceName: widget.model.cmcAllServicesList[index - 1].description,
child: SecondaryButton( selectedServiceNameAR: widget.model.cmcAllServicesList[index - 1].descriptionN,
label: TranslationBase.of(context).next, recordID: 1,
textColor: Theme.of(context).backgroundColor, totalPrice: widget.model.cmcAllServicesList[index - 1].totalPrice,
color: CustomColors.accentColor, vAT: widget.model.cmcAllServicesList[index - 1].vAT);
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);
widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList];
await widget.model.getCustomerInfo(); await widget.model.getCustomerInfo();
if (widget.model.state == ViewState.ErrorLocal) { if (widget.model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(); Utils.showErrorToast();
} else { } else {
navigateTo(context,NewCMCStepTowPage( navigateTo(
longitude: widget.longitude, context,
latitude: widget.latitude, NewCMCStepTowPage(
cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel, longitude: widget.longitude,
model: widget.model, latitude: widget.latitude,
)); cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel,
model: widget.model,
));
// widget.changePageViewIndex(1); // widget.changePageViewIndex(1);
}
} }
}, }
), },
), ),
], ),
), ],
), ),
); );
} }

@ -2,12 +2,14 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.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/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'NewCMC/new_cmc_page.dart'; import 'NewCMC/new_cmc_page.dart';
import 'orders_log_details_page.dart'; import 'orders_log_details_page.dart';
@ -34,6 +36,7 @@ class _CMCPageState extends State<CMCPage> with SingleTickerProviderStateMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<CMCViewModel>( return BaseView<CMCViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getCmcAllPresOrders(); await model.getCmcAllPresOrders();
@ -47,61 +50,35 @@ class _CMCPageState extends State<CMCPage> with SingleTickerProviderStateMixin {
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Container( TabBar(
height: 60.0, controller: _tabController,
width: double.infinity, indicatorWeight: 3.0,
child: Center( indicatorSize: TabBarIndicatorSize.tab,
child: TabBar( labelColor: Color(0xff2B353E),
isScrollable: false, unselectedLabelColor: Color(0xff575757),
controller: _tabController, labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
indicatorWeight: 3.0, labelStyle: TextStyle(
indicatorSize: TabBarIndicatorSize.tab, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
indicatorColor: CustomColors.accentColor, fontSize: 16,
labelColor: Colors.black, fontWeight: FontWeight.w600,
labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), letterSpacing: -0.48,
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,
),
),
),
],
),
), ),
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( Expanded(
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[NewCMCPage(model: model), OrdersLogDetailsPage(model: model)],
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/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -25,234 +28,148 @@ class OrdersLogDetailsPage extends StatelessWidget {
void showConfirmMessage(CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { void showConfirmMessage(CMCViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmCancelOrderDialog( child: ConfirmCancelOrderDialog(
model: model, model: model,
onTap: () async { onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
await model.updateCmcPresOrder(updatePresOrderRequestModel); await model.updateCmcPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getCmcAllPresOrders(); await model.getCmcAllPresOrders();
} }
}, },
)); ),
);
} }
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: ListView.separated(
physics: ScrollPhysics(), padding: EdgeInsets.all(21),
child: Container( physics: BouncingScrollPhysics(),
margin: EdgeInsets.all(12), itemBuilder: (context, index) {
child: Center( GetHHCAllPresOrdersResponseModel order = model.cmcAllPresOrders[index];
child: FractionallySizedBox(
widthFactor: 0.94, int status = order.status;
child: Column( String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description;
crossAxisAlignment: CrossAxisAlignment.start, Color _color;
children: [ if (status == 1) {
Column( //pending
crossAxisAlignment: CrossAxisAlignment.start, _color = Color(0xffCC9B14);
children: model.cmcAllPresOrders.map((order) { } else if (status == 2) {
return Container( //processing
width: double.infinity, _color = Color(0xff2E303A);
margin: EdgeInsets.only(top: 12), } else if (status == 3) {
clipBehavior: Clip.antiAlias, //completed
decoration: BoxDecoration(border: Border.all(color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12), color: Colors.white), _color = Color(0xff359846);
child: Column( } 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, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( Text(
height: 6, 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: 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,
),
),
],
),
), ),
Container( Expanded(
width: double.infinity, child: Text(
padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
decoration: BoxDecoration( style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
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,
),
),
],
), ),
), ),
Container( ],
width: double.infinity, )
padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), ],
decoration: BoxDecoration( ),
border: Border( ),
bottom: BorderSide( Column(
color: Colors.grey, mainAxisAlignment: MainAxisAlignment.spaceBetween,
width: 1.0, crossAxisAlignment: CrossAxisAlignment.end,
), children: [
), Text(
// borderRadius: BorderRadius.circular(12), DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic),
), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, SizedBox(height: 12),
children: [ if (order.status == 1 || order.status == 2)
Text( InkWell(
TranslationBase.of(context).pickupDate, onTap: () {
style: TextStyle( showConfirmMessage(model, order);
fontSize: 13, },
fontWeight: FontWeight.w600, child: Container(
letterSpacing: -0.45, padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
), decoration: BoxDecoration(
), color: Color(0xffD02127),
SizedBox( border: Border.all(color: Colors.white, width: 1),
height: 4, borderRadius: BorderRadius.circular(10),
),
Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)),
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
letterSpacing: -0.45,
),
),
],
),
), ),
Container( child: Text(
width: double.infinity, TranslationBase.of(context).cancel_nocaps,
clipBehavior: Clip.antiAlias, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
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,
),
),
],
),
), ),
(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/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/PatientERHHCInsertServicesList.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.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'; 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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -42,106 +44,83 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: widget.model, baseViewModel: widget.model,
body: SingleChildScrollView( body: Column(
physics: ScrollPhysics(), children: [
child: Container( Expanded(
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.05, right: MediaQuery.of(context).size.width * 0.05), child: ListView.separated(
child: Center( physics: BouncingScrollPhysics(),
child: FractionallySizedBox( padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12),
widthFactor: 1, itemBuilder: (context, index) {
child: Column( HHCGetAllServicesResponseModel service = widget.model.hhcAllServicesList[index];
crossAxisAlignment: CrossAxisAlignment.start,
children: [ return Padding(
// Texts( padding: const EdgeInsets.only(top: 4, bottom: 4),
// TranslationBase.of(context).selectHomeHealthCareServices, child: Row(
// textAlign: TextAlign.center, children: [
// ), Checkbox(
Column( value: isServiceSelected(service.serviceID),
children: widget.model.hhcAllServicesList.map((service) { activeColor: Color(0xffD02127),
return Container( tristate: false,
margin: EdgeInsets.only(top: 10), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
decoration: BoxDecoration( onChanged: (bool newValue) {
// border: Border.all(color: Colors.grey, width: 1), setState(() {
borderRadius: BorderRadius.circular(12), 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( separatorBuilder: (context, index) => Divider(
value: isServiceSelected(service.serviceID), height: 1,
activeColor: Colors.red[800], color: Color(0xffE5E5E5),
tristate: false, ),
onChanged: (bool newValue) { itemCount: widget.model.hhcAllServicesList.length),
setState(() { ),
if (!isServiceSelected(service.serviceID)) Container(
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList( color: Colors.white,
recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
serviceID: service.serviceID, child: DefaultButton(
serviceName: service.description)); TranslationBase.of(context).next,
else (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal)
removeSelected(service.serviceID); ? null
// widget.patientERInsertPresOrderRequestModel : () async {
// isPatientInsured = newValue; widget.model.setState(ViewState.Busy);
}); await widget.model.getCustomerInfo();
}), if (widget.model.state == ViewState.ErrorLocal) {
Expanded( Utils.showErrorToast();
child: Padding( } else {
padding: const EdgeInsets.only(left: 0.0, right: 10), Navigator.push(
child: Texts( context,
projectViewModel.isArabic ? service.descriptionN : service.description.toLowerCase()?.capitalize(), FadePage(
fontSize: 15, page: NewHomeHealthCareStepTowPage(
style: 'letterSpacing: -0.48', patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
fontWeight: FontWeight.bold, model: widget.model,
),
),
),
],
), ),
Divider( ),
height: 1, );
color: Colors.grey, }
) },
], textColor: (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal) ? Color(0xff000000) : Colors.white,
), disabledColor: Color(0xffEAEAEA),
);
}).toList(),
),
SizedBox(height: 70)
],
),
), ),
), ),
), ],
),
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}); NewHomeHealthCarePage({this.model});
final HomeHealthCareViewModel model; final HomeHealthCareViewModel model;
@override @override
_NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState(); _NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState();
} }
@ -94,15 +95,6 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
height: MediaQuery.of(context).size.height * 0.8, height: MediaQuery.of(context).size.height * 0.8,
child: Column( child: Column(
children: [ 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( Expanded(
child: PageView( child: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -190,25 +182,17 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
fontSize: 14, fontSize: 14,
), ),
mHeight(8), mHeight(8),
SecondaryButton( // SecondaryButton(
onTap: () { // onTap: () {
showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); // showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
}, // },
label: TranslationBase.of(context).cancel, // label: TranslationBase.of(context).cancel,
color: Colors.red[900], // color: Colors.red[900],
small: true, // small: true,
) // )
], ],
), ),
], ],
// )
// ],
// )
// ],
// ),
// ],
//))
// ],
))), ))),
)))) ))))
: NewHomeHealthCareStepOnePage( : NewHomeHealthCareStepOnePage(

@ -2,12 +2,14 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'NewHomeHealthCare/new_home_health_care_page.dart'; import 'NewHomeHealthCare/new_home_health_care_page.dart';
import 'orders_log_details_page.dart'; import 'orders_log_details_page.dart';
@ -34,6 +36,7 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage> with SingleTick
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<HomeHealthCareViewModel>( return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getHHCAllPresOrders(); model.getHHCAllPresOrders();
@ -45,67 +48,44 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage> with SingleTick
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: 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')], imagesInfo: [ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png')],
body: Scaffold( body: Column(
extendBodyBehindAppBar: true, children: <Widget>[
appBar: PreferredSize( TabBar(
preferredSize: Size.fromHeight(65.0), controller: _tabController,
child: Stack( indicatorWeight: 3.0,
children: <Widget>[ indicatorSize: TabBarIndicatorSize.tab,
Center( labelColor: Color(0xff2B353E),
child: Center( unselectedLabelColor: Color(0xff575757),
child: TabBar( labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
isScrollable: true, labelStyle: TextStyle(
controller: _tabController, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
indicatorWeight: 5.0, fontSize: 16,
indicatorSize: TabBarIndicatorSize.tab, fontWeight: FontWeight.w600,
indicatorColor: Colors.red[800], letterSpacing: -0.48,
labelColor: Theme.of(context).primaryColor, ),
labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), unselectedLabelStyle: TextStyle(
unselectedLabelColor: Colors.grey[800], fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
tabs: [ fontSize: 16,
Container( fontWeight: FontWeight.w600,
width: MediaQuery.of(context).size.width * 0.37, letterSpacing: -0.48,
child: Center( ),
child: Texts( tabs: [Text(TranslationBase.of(context).homeHealthCare), Text(TranslationBase.of(context).orderLog)],
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,
),
),
),
],
),
),
),
],
), ),
), Expanded(
body: Column( child: TabBarView(
children: <Widget>[ physics: BouncingScrollPhysics(),
Expanded( controller: _tabController,
child: TabBarView( children: <Widget>[
physics: BouncingScrollPhysics(), NewHomeHealthCarePage(
controller: _tabController, model: model,
children: <Widget>[ ),
NewHomeHealthCarePage( OrdersLogDetailsPage(
model: model, model: model,
), )
OrdersLogDetailsPage( ],
model: model, ),
) )
], ],
),
)
],
),
), ),
), ),
); );

@ -27,142 +27,150 @@ class OrdersLogDetailsPage extends StatelessWidget {
void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmCancelOrderDialog( child: ConfirmCancelOrderDialog(
model: model, model: model,
onTap: () async { onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
model.setState(ViewState.Busy); model.setState(ViewState.Busy);
await model.updateHHCPresOrder(updatePresOrderRequestModel); await model.updateHHCPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getHHCAllPresOrders(); await model.getHHCAllPresOrders();
// await model.getHHCAllServices(); // await model.getHHCAllServices();
} }
}, },
)); ),
);
} }
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: ListView.separated(
physics: ScrollPhysics(), padding: EdgeInsets.all(21),
child: Container( physics: BouncingScrollPhysics(),
margin: EdgeInsets.all(10), itemBuilder: (context, index) {
child: Center( GetHHCAllPresOrdersResponseModel order = model.hhcAllPresOrders[index];
child: FractionallySizedBox(
widthFactor: 0.94, int status = order.status;
child: Column( String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description;
crossAxisAlignment: CrossAxisAlignment.start, Color _color;
children: [ if (status == 1) {
Column( //pending
crossAxisAlignment: CrossAxisAlignment.start, _color = Color(0xffCC9B14);
children: model.hhcAllPresOrders.map((order) { } else if (status == 2) {
return Container( //processing
// margin: EdgeInsets.all(10), _color = Color(0xff2E303A);
child: Container( } else if (status == 3) {
width: double.infinity, //completed
padding: EdgeInsets.only(left: 12, right: 12, top: 12), _color = Color(0xff359846);
child: Card( } else if (status == 4) {
shape: cardRadius(12), //cancel // Rejected
elevation: 2, _color = Color(0xffD02127);
margin: EdgeInsets.zero, }
color: order.status == 4 return Container(
? Colors.red[900] decoration: BoxDecoration(
: order.status == 3 color: _color,
? Colors.green[400] borderRadius: BorderRadius.all(
: Color(0xffcd9e1b), Radius.circular(10.0),
clipBehavior: Clip.antiAlias, ),
child: Container( boxShadow: [
// decoration: containerColorRadiusLeft(Colors.white, 12), BoxShadow(
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0), color: Color(0xff000000).withOpacity(.05),
padding: EdgeInsets.all(12), blurRadius: 27,
// color: Colors.white, offset: Offset(0, -3),
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())
], ],
), ),
), 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.clinicID = widget.patientShareResponse.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; 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) { if (value != null) {
openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
} }

@ -171,7 +171,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
child: Text( child: Text(
TranslationBase.of(context).availableAppo, TranslationBase.of(context).availableAppo,
style: TextStyle( style: TextStyle(
color: Colors.black, color: widget.isLiveCareAppointment ? Colors.grey : Colors.black,
fontSize: 12, fontSize: 12,
letterSpacing: -0.36, letterSpacing: -0.36,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -358,6 +358,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
}); });
} else { } else {
DocAvailableAppointments.areAppointmentsAvailable = false; DocAvailableAppointments.areAppointmentsAvailable = false;
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); 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/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.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/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -66,7 +67,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
ScrollController _scrollController; ScrollController _scrollController;
ProjectViewModel projectViewModel; ToDoCountProviderModel toDoProvider;
@override @override
void initState() { void initState() {
@ -119,203 +120,211 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: SingleChildScrollView( backgroundColor: CustomColors.appBackgroudGrey2Color,
child: Container( body: Column(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), children: [
child: Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: SingleChildScrollView(
children: <Widget>[ child: Container(
Container( margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
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(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[ 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( Container(
height: 40, child: Column(
child: ListView.builder( crossAxisAlignment: CrossAxisAlignment.start,
controller: _scrollController, mainAxisSize: MainAxisSize.max,
scrollDirection: Axis.horizontal, children: <Widget>[
itemCount: dayEvents.length, Text(
itemBuilder: (context, index) { TranslationBase.of(context).selectAppo,
return Container( style: TextStyle(
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5), color: Colors.black,
child: ButtonTheme( fontSize: 16.0,
shape: RoundedRectangleBorder( letterSpacing: -0.64,
borderRadius: BorderRadius.circular(5.0), fontWeight: FontWeight.w600,
side: BorderSide( ),
color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border ),
style: BorderStyle.solid, //Style of the border Card(
width: 1.5, //width of the border shape: cardRadius(12),
), child: _buildTableCalendarWithBuilders(projectViewModel),
), ),
minWidth: MediaQuery.of(context).size.width * 0.18, mHeight(12),
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)), 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, ),
), Card(
if (CovidTimeSlots.areSlotsAvailable) elevation: 20,
Container( margin: EdgeInsets.zero,
color: Colors.grey[100], shape: cardRadius(0),
margin: EdgeInsets.all(10.0), child: Container(
child: DefaultButton( width: double.infinity,
TranslationBase.of(context).bookNow, padding: EdgeInsets.all(12),
() { child: ButtonTheme(
bookCovidTestAppointment(); 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) { Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
return Card( return TableCalendar(
shape: cardRadius(12), locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US',
margin: EdgeInsets.all(16), calendarController: _calendarController,
clipBehavior: Clip.antiAlias, events: _events,
child: Padding( initialCalendarFormat: CalendarFormat.month,
padding: const EdgeInsets.only(bottom: 12), startDay: DateTime.now(),
child: TableCalendar( formatAnimation: FormatAnimation.slide,
locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US', startingDayOfWeek: StartingDayOfWeek.sunday,
calendarController: _calendarController, weekendDays: [DateTime.friday, DateTime.saturday],
events: _events, availableGestures: AvailableGestures.horizontalSwipe,
initialCalendarFormat: CalendarFormat.month, availableCalendarFormats: const {
startDay: DateTime.now(), CalendarFormat.month: '',
formatAnimation: FormatAnimation.slide, CalendarFormat.week: '',
startingDayOfWeek: StartingDayOfWeek.sunday, },
weekendDays: [DateTime.friday, DateTime.saturday], calendarStyle: CalendarStyle(
availableGestures: AvailableGestures.horizontalSwipe, outsideDaysVisible: false,
availableCalendarFormats: const { weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
CalendarFormat.month: '', holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
CalendarFormat.week: '', ),
}, daysOfWeekStyle: DaysOfWeekStyle(
calendarStyle: CalendarStyle( weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
outsideDaysVisible: false, weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]), ),
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
), builders: CalendarBuilders(
daysOfWeekStyle: DaysOfWeekStyle( selectedDayBuilder: (context, date, _) {
weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600), return FadeTransition(
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600), opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
), child: Container(
headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)), margin: const EdgeInsets.all(4.0),
builders: CalendarBuilders( padding: const EdgeInsets.only(top: 5.0, left: 6.0),
selectedDayBuilder: (context, date, _) { color: Colors.transparent,
return FadeTransition( width: 0,
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), height: 0,
child: Container( child: Text(
margin: const EdgeInsets.all(4.0), '${date.day}',
padding: const EdgeInsets.only(top: 5.0, left: 5.0), style: TextStyle().copyWith(fontSize: 14.0),
color: Colors.transparent, ),
width: 0, ),
height: 0, );
child: Text( },
'${date.day}', todayDayBuilder: (context, date, _) {
style: TextStyle().copyWith(fontSize: 14.0), return Container(
), decoration: BoxDecoration(
), shape: BoxShape.circle,
); color: _calendarController.isSelected(date)
}, ? Colors.green[400]
todayDayBuilder: (context, date, _) { : _calendarController.isToday(date)
return Container( ? Colors.transparent
decoration: BoxDecoration( : Color(0xff76cfb7),
shape: BoxShape.circle, ),
color: _calendarController.isSelected(date) width: 40.0,
? Colors.green[400] height: 40.0,
: _calendarController.isToday(date) child: Center(
? Colors.transparent child: Text(
: Color(0xff76cfb7), '${date.day}',
), style: TextStyle().copyWith(
width: 40.0, color: Colors.white,
height: 40.0, fontSize: 14.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
),
),
), ),
); ),
}, ),
markersBuilder: (context, date, events, holidays) { );
final children = <Widget>[]; },
markersBuilder: (context, date, events, holidays) {
if (events.isNotEmpty) { final children = <Widget>[];
children.add(
Positioned( if (events.isNotEmpty) {
right: 4, children.add(
bottom: 4, Positioned(
child: _buildEventsMarker(date, events), right: 4,
), bottom: 4,
); child: _buildEventsMarker(date, events),
} ),
);
}
return children; return children;
}, },
),
onDaySelected: (date, event, _) {
_onDaySelected(date, event, projectViewModel);
_animationController.forward(from: 0.0);
},
onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,
),
), ),
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); _eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() { setState(() {
CovidTimeSlots.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); 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']; selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots'];
}); });
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
@ -363,12 +372,21 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
Widget _buildEventsMarker(DateTime date, List events) { Widget _buildEventsMarker(DateTime date, List events) {
return Container( 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( decoration: containerColorRadiusBorderWidth(
_calendarController.isSelected(date) _calendarController.isSelected(date)
? CustomColors.green ? CustomColors.green
: _calendarController.isToday(date) : _calendarController.isToday(date)
? CustomColors.green.withOpacity(0.5) ? CustomColors.green.withOpacity(0.5)
: Colors.white, : Colors.white,
200, 200,
_calendarController.isSelected(date) ? CustomColors.green : Colors.black, _calendarController.isSelected(date) ? CustomColors.green : Colors.black,
2), 2),
@ -379,7 +397,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
'${date.day}', '${date.day}',
style: TextStyle().copyWith( style: TextStyle().copyWith(
color: _calendarController.isSelected(date) ? Colors.white : Colors.black, 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(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
CovidTimeSlots.selectedTime = dayEvents[index].isoTime; 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) { Widget getSelectedButton(int index) {
return RaisedButton( return RaisedButton(
color: CustomColors.green, color: CustomColors.green, //Color of the border
//Color of the border
textColor: Colors.white, textColor: Colors.white,
elevation: 0,
onPressed: () { onPressed: () {
setState(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
CovidTimeSlots.selectedTime = dayEvents[index].isoTime; 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() { bookCovidTestAppointment() {
var messageEn = "This Appointment is being booked for patient " + GifLoaderDialogUtils.showMyDialog(context);
projectViewModel.user.firstName + DoctorList docObject = new DoctorList();
" " + docObject.doctorID = widget.selectedDoctorID;
projectViewModel.user.lastName + docObject.clinicID = widget.selectedClinicID;
", Having file number " + docObject.projectID = widget.projectID;
projectViewModel.user.patientID.toString() + insertAppointmentCovidTest(context, docObject);
". 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);
} }
insertAppointmentCovidTest(context, DoctorList docObject) { insertAppointmentCovidTest(context, DoctorList docObject) {
@ -452,6 +452,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully"); AppToast.showSuccessToast(message: "Appointment Booked Successfully");
getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); 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) { cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) { service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
// Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointmentCovidTest(context, docObject); insertAppointmentCovidTest(context, docObject);
// });
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -522,26 +538,24 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
} }
getCovidFreeSlots(BuildContext context, int projectID) { getCovidFreeSlots(BuildContext context, int projectID) {
CovidTimeSlots.areSlotsAvailable = false;
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidFreeSlots(context, projectID).then((res) { service.getCovidFreeSlots(context, projectID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['COVID19_FreeTimeSlots'].length != 0) { if (res['COVID19_FreeTimeSlots'].length != 0) {
CovidTimeSlots.areSlotsAvailable = true;
freeSlotsResponse = res['COVID19_FreeTimeSlots']; freeSlotsResponse = res['COVID19_FreeTimeSlots'];
_getJSONSlots().then((value) => { _getJSONSlots().then((value) => {
setState(() => {widget.selectedClinicID = freeSlotsResponse[0]['ClinicID'], widget.selectedDoctorID = freeSlotsResponse[0]['DoctorID'], _events.clear(), _events = value}) setState(() => {widget.selectedClinicID = freeSlotsResponse[0]['ClinicID'], widget.selectedDoctorID = freeSlotsResponse[0]['DoctorID'], _events.clear(), _events = value})
}); });
} else { } else {}
CovidTimeSlots.areSlotsAvailable = false;
}
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err.toString());
print(err); print(err);
}); });
} }

@ -5,10 +5,11 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoRespo
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.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/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -29,7 +30,6 @@ class CovidDirveThruQuestions extends StatefulWidget {
class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> { class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
List qa; List qa;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -37,91 +37,212 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
qa = getQuestionsFromJson(); qa = getQuestionsFromJson();
} }
TranslationBase localize;
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
localize = TranslationBase.of(context);
var isArabic = localize.isArabic();
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
var isArabic = projectViewModel.isArabic;
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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( Expanded(
child: ListView.separated( child: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 20), child: Padding(
itemCount: qa.length, padding: const EdgeInsets.all(16.0),
itemBuilder: (ctx, idx) {
var obj = qa[idx];
var qtext = isArabic ? obj["questionAR"] : obj["questionEN"];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(qtext, style: TextStyle(fontSize: 15, letterSpacing: 1.5)), Container(
Row( width: double.infinity,
children: [ child: Card(
Radio<int>( shape: cardRadius(12),
value: 1, margin: EdgeInsets.zero,
groupValue: obj["ans"], child: Padding(
onChanged: (newValue) { padding: const EdgeInsets.all(12.0),
setState(() { child: Column(
obj["ans"] = newValue; crossAxisAlignment: CrossAxisAlignment.start,
}); children: [
}), Text(
Text(TranslationBase.of(context).yes), 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)), ),
)), Card(
Padding( margin: EdgeInsets.zero,
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), elevation: 20,
child: FractionallySizedBox( child: Container(
widthFactor: 1, padding: EdgeInsets.all(12),
child: DefaultButton(TranslationBase.of(context).next, () { child: FractionallySizedBox(
next(); 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); getPaymentInfo(context, widget.projectId);
} }
else else
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseSelectAllQuestionToContinue); AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue);
} }
openPassportUpdatePage() { openPassportUpdatePage() {

@ -67,7 +67,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
isShowDecPage: true, isShowDecPage: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -113,7 +113,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
), ),
), ),
Container( Container(
height: 18, height: 20,
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<DriveThroughTestingCenterModel>( child: DropdownButton<DriveThroughTestingCenterModel>(
onTap: () { onTap: () {
@ -185,10 +185,13 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
padding: const EdgeInsets.only(left: 12, right: 12, top: 6, bottom: 6), padding: const EdgeInsets.only(left: 12, right: 12, top: 6, bottom: 6),
child: Row( child: Row(
children: [ children: [
SvgPicture.asset( Padding(
"assets/images/new/blood_pressure.svg", padding: const EdgeInsets.all(3.0),
width: 18, child: SvgPicture.asset(
height: 18, "assets/images/new/direction.svg",
width: 13,
height: 13,
),
), ),
mWidth(6), mWidth(6),
Text( Text(
@ -218,33 +221,38 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
), ),
), ),
), ),
Container( Card(
width: double.infinity, elevation: 20,
padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), margin: EdgeInsets.zero,
child: ButtonTheme( child: Container(
shape: RoundedRectangleBorder( width: double.infinity,
borderRadius: BorderRadius.circular(10.0), padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
), child: ButtonTheme(
minWidth: MediaQuery.of(context).size.width * 0.7, shape: RoundedRectangleBorder(
height: 45.0, borderRadius: BorderRadius.circular(10.0),
child: RaisedButton( ),
color: CustomColors.accentColor, minWidth: MediaQuery.of(context).size.width * 0.7,
textColor: Colors.white, height: 45.0,
disabledTextColor: Colors.white, child: RaisedButton(
disabledColor: CustomColors.accentColor, color: CustomColors.accentColor,
onPressed: () { textColor: Colors.white,
next(); disabledTextColor: Colors.white,
}, disabledColor: CustomColors.accentColor,
child: Text( elevation: 0,
TranslationBase.of(context).next, onPressed: () {
style: TextStyle( next();
fontSize: 16.0, },
fontWeight: FontWeight.bold, child: Text(
letterSpacing: -0.44, 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(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
CovidTestProceduresResponse covidTestProceduresResponse = new CovidTestProceduresResponse();
service.getCovidTestProceduresList(context).then((res) { service.getCovidTestProceduresList(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res);
setState(() { setState(() {
res['COVID19_TestProceduresList'].forEach((v) { res['COVID19_TestProceduresList'].forEach((v) {
proceduresList.add(new CovidTestProceduresResponse.fromJson(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/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.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/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -30,215 +31,135 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: SingleChildScrollView( showNewAppBar: true,
child: Column( backgroundColor: CustomColors.appBackgroudGrey2Color,
crossAxisAlignment: CrossAxisAlignment.start, body: Column(
children: <Widget>[ children: [
Container( Expanded(
height: 180.0, child: SingleChildScrollView(
color: new Color(0xFFc5272d), child: Column(
child: Row( crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(left: 50.0), color: new Color(0xFFc5272d),
child: SvgPicture.asset( padding: EdgeInsets.all(20),
'assets/images/new-design/alert_icon.svg', child: Row(
width: 80.0,
height: 80.0),
),
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Icon(
margin: EdgeInsets.only(left: 30.0, right: 20.0), Icons.warning_outlined,
child: Text(TranslationBase.of(context).covidAlert, color: Colors.white,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 24.0)),
), ),
Container( mWidth(12),
width: MediaQuery.of(context).size.width * 0.55, Expanded(
margin: EdgeInsets.only(
left: 30.0, right: 20.0, top: 5.0),
child: Text( child: Text(
TranslationBase.of(context).covidAlertHeader, TranslationBase.of(context).covidAlertHeader,
// "Pay With-in 15 mins to confirm the appointment", style: TextStyle(
overflow: TextOverflow.clip, color: Colors.white,
style: TextStyle( fontWeight: FontWeight.w600,
color: Colors.white, fontSize: 20.0)), 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( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0),
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),
],
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Text(
margin: EdgeInsets.only( TranslationBase.of(context).covidAlertMins,
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), style: TextStyle(
child: Text(TranslationBase.of(context).covidTest, fontSize: 19.0,
style: TextStyle( letterSpacing: -1.6,
fontSize: 18.0, fontWeight: FontWeight.bold,
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])),
),
],
), ),
), ),
Container( Text(
margin: EdgeInsets.only(bottom: 10.0), TranslationBase.of(context).covidAlertInfo,
child: Row( style: TextStyle(
children: <Widget>[ color: Colors.grey[700],
Container( fontSize: 14.0,
margin: letterSpacing: -0.56,
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])),
),
],
), ),
), ),
mHeight(20),
Container( Container(
margin: EdgeInsets.only(bottom: 10.0), width: double.infinity,
child: Row( child: Card(
children: <Widget>[ margin: EdgeInsets.zero,
Container( shape: cardRadius(12),
margin: child: Padding(
EdgeInsets.only(left: 20.0, right: 20.0), padding: const EdgeInsets.all(12.0),
child: SvgPicture.asset( child: Column(
"assets/images/new-design/track_icon.svg", crossAxisAlignment: CrossAxisAlignment.start,
width: 20.0, children: [
height: 20.0)), Text(
Container( TranslationBase.of(context).appoInfo,
child: Text(
widget.patientShareResponse.doctorNameObj !=
null
? widget
.patientShareResponse.doctorNameObj
: "NULL",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 16.0,
color: Colors.grey[700])), 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), Card(
child: DefaultButton( margin: EdgeInsets.zero,
TranslationBase.of(context).next, elevation: 20,
() { child: Container(
startPaymentProcess(); 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); navigateToPaymentMethod(context, widget.patientShareResponse);
} }
Future navigateToPaymentMethod( Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async {
context, PatientShareResponse patientShareResponse) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
setState(() { setState(() {
authUser = data; authUser = data;
}); });
} }
Navigator.push( Navigator.push(
context, FadePage(page: PaymentMethod())) context,
.then((value) { FadePage(
print(value); page: CovidPaymentSummary(patientShareResponse: widget.patientShareResponse, selectedPaymentMethod: "MADA"),
if (value != null) { ),
Navigator.push( );
context, // Navigator.push(context, FadePage(page: PaymentMethod())).then((value) {
FadePage( // print(value);
page: CovidPaymentSummary( // if (value != null) {
patientShareResponse: widget.patientShareResponse, // Navigator.push(
selectedPaymentMethod: value.toString()), // context,
), // FadePage(
); // page: CovidPaymentSummary(patientShareResponse: widget.patientShareResponse, selectedPaymentMethod: value.toString()),
} // ),
}); // );
// }
// });
} }
String getDate(String appoDate) { 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/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class CovidPaymentDetails extends StatefulWidget { class CovidPaymentDetails extends StatefulWidget {
CovidPaymentInfoResponse covidPaymentInfoResponse; CovidPaymentInfoResponse covidPaymentInfoResponse;
@ -34,60 +37,70 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: SingleChildScrollView( showNewAppBar: true,
child: Container( backgroundColor: CustomColors.appBackgroudGrey2Color,
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0), body: Container(
child: Column( // margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0),
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ child: Column(
Container( children: [
height: 150.0, Expanded(
decoration: BoxDecoration( child: Padding(
image: DecorationImage( padding: EdgeInsets.all(16),
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),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( // Container(
alignment: Alignment.center, // height: 150.0,
margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0), // decoration: BoxDecoration(
child: Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 20.0, fontWeight: FontWeight.bold)), // 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( ...List.generate(
widget.proceduresList.length, widget.proceduresList.length,
(index) => Column( (index) => Column(
@ -107,7 +120,14 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
}); });
}, },
child: ListTile( 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( leading: Radio(
value: widget.proceduresList[index], value: widget.proceduresList[index],
groupValue: widget.selectedProcedure, 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( Container(
alignment: Alignment.center, margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 0.0), child: Row(
child: Text(TranslationBase.of(context).testFee, style: TextStyle(color: Colors.black, fontSize: 22.0, fontWeight: FontWeight.bold)), 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( mFlex(1),
children: [
TableRow(children: [ Text(
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)), TranslationBase.of(context).payOptions,
TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientShareField.toString())), textAlign: TextAlign.center,
]), style: TextStyle(
TableRow(children: [ fontSize: 12.0,
TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)), fontWeight: FontWeight.w600,
TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientTaxAmountField.toString())), letterSpacing: -0.46,
]), ),
TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientShareWithTaxField.toString())),
]),
],
), ),
], Container(
), margin: EdgeInsets.only(top: 12, bottom: 12),
), child: Image.asset("assets/images/new-design/payment_options_invoice_confirmation.png", width: 300),
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),
), ),
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( Container(
flex: 1, width: double.infinity,
child: Container( child: Card(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), elevation: 20,
child: ButtonTheme( margin: EdgeInsets.zero,
shape: RoundedRectangleBorder( child: Padding(
borderRadius: BorderRadius.circular(10.0), padding: const EdgeInsets.only(top: 12, bottom: 12, left: 12, right: 12),
), child: Row(
minWidth: MediaQuery.of(context).size.width * 0.7, children: [
height: 45.0, Expanded(
child: DefaultButton( flex: 1,
TranslationBase.of(context).next, child: Container(
isAgree child: ButtonTheme(
? () { shape: RoundedRectangleBorder(
next(); borderRadius: BorderRadius.circular(10.0),
} ),
: null, minWidth: MediaQuery.of(context).size.width * 0.7,
disabledColor: Color(0x8ac5272d), 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) { _getNormalText(text, {bool isBold = false}) {
return Container( return Text(
margin: EdgeInsets.only(top: 20.0, right: 10.0), text,
child: Text(text, textAlign: TextAlign.end, style: TextStyle(fontSize: 15, fontFamily: 'Open-Sans', letterSpacing: 0.5, color: Colors.grey[700])), 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/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.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/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -22,7 +24,7 @@ import 'package:provider/provider.dart';
class CovidPaymentSummary extends StatefulWidget { class CovidPaymentSummary extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
final String selectedPaymentMethod; String selectedPaymentMethod;
MyInAppBrowser browser; MyInAppBrowser browser;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
@ -41,8 +43,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
@ -50,28 +53,65 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).confirmThePayment, TranslationBase.of(context).confirmThePayment,
textAlign: TextAlign.center, style: TextStyle(
fontWeight: FontWeight.w500, fontSize: 19,
fontSize: 24, fontWeight: FontWeight.bold,
letterSpacing: -1.46,
),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ 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( Container(
height: 100.0, height: 60.0,
padding: EdgeInsets.all(7.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)), child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)),
), ),
Texts( mFlex(1),
'${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar, InkWell(
fontSize: 26, onTap: () {
bold: true, 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( Row(
children: [ children: [
Expanded( Expanded(
child: Container( flex: 1,
margin: EdgeInsets.all(3), child: showDetail(
child: NewTextFields( TranslationBase.of(context).fileNumber,
hintText: TranslationBase.of(context).fileNumber, projectViewModel.user.patientID.toString(),
initialValue: projectViewModel.user.patientID.toString(),
isEnabled: false,
),
), ),
), ),
mWidth(6),
Expanded( Expanded(
child: Container( flex: 1,
margin: EdgeInsets.all(3), child: showDetail(
child: NewTextFields( TranslationBase.of(context).name,
hintText: TranslationBase.of(context).name, projectViewModel.user.firstName.toString(),
initialValue: projectViewModel.user.firstName,
isEnabled: false,
),
), ),
), ),
], ],
), ),
SizedBox( SizedBox(
height: 12, height: 6,
),
NewTextFields(
hintText: TranslationBase.of(context).mobileNumber,
initialValue: projectViewModel.user.mobileNumber,
isEnabled: false,
), ),
showDetail(TranslationBase.of(context).mobileNumber, projectViewModel.user.mobileNumber),
SizedBox( SizedBox(
height: 12, height: 6,
),
NewTextFields(
hintText: TranslationBase.of(context).depositorName,
initialValue: projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName,
isEnabled: false,
), ),
showDetail(
TranslationBase.of(context).depositorName,
projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName,
)
], ],
), ),
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
color: Colors.grey[100], color: Colors.white,
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).confirm.toUpperCase(), textColor: Colors.white,
() { color: CustomColors.green,
label: TranslationBase.of(context).confirm.toUpperCase(),
onTap: () {
startPaymentProcess(projectViewModel.user); 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) { startPaymentProcess(AuthenticatedUser authenticatedUser) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientShareResponse.projectID; appo.projectID = widget.patientShareResponse.projectID;

@ -1,71 +1,80 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; 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:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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)); 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 PrescriptionsOrder order;
final Function(PrescriptionsOrder) onCancel; final Function(PrescriptionsOrder) onCancel;
RRTLogListItem(this.order, {this.onCancel}); RRTLogListItem(this.order, {this.onCancel});
BuildContext _context; BuildContext _context;
TranslationBase localize; TranslationBase localize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
_context = context; _context = context;
localize = TranslationBase.of(context); localize = TranslationBase.of(context);
return Container( return Container(
padding: EdgeInsets.all(15), margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10), padding: EdgeInsets.all(15),
decoration: BoxDecoration( margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
color: Colors.white, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15), boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)]),
borderRadius: BorderRadius.circular(15),
boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)]
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
_contentItem(label: localize.reqId, value: order.iD.toString()), _contentItem(label: localize.reqId, value: order.iD.toString()),
_item_content_seperator, _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, _item_content_seperator,
_contentItem(label: localize.pickupDate, value: order.getFormattedDateTime()), _contentItem(label: localize.pickupDate, value: order.getFormattedDateTime()),
_item_content_seperator, _item_content_seperator,
_contentItem(label: localize.location, value: order.getNearestProjectDescription()), _contentItem(label: localize.location, value: order.getNearestProjectDescription()),
_item_content_seperator, _item_content_seperator,
SizedBox(height: 10), SizedBox(height: 10),
if (onCancel != null && order.status == 1 && order.status == 2) FractionallySizedBox(child: cancelButton())
if(onCancel != null)
FractionallySizedBox(child: cancelButton())
], ],
), ),
); );
} }
Widget _contentItem({@required String label, String value}){ Widget _contentItem({@required String label, String value}) {
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 10), padding: EdgeInsets.symmetric(vertical: 10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(label, style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),), Text(
SizedBox(height: 5,), label,
Text(value, style: TextStyle(color: Theme.of(_context).appBarTheme.color,fontWeight: FontWeight.bold, fontSize: 14),), 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( Widget cancelButton() => MaterialButton(
height: 45, height: 45,
color: Color(0xFFc5272d), color: Color(0xFFc5272d),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
onPressed: () => onCancel(order), onPressed: () => onCancel(order),
child: Text(localize.cancel, style: TextStyle(color: Colors.white, fontSize: 13),), 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/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.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/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
@ -36,97 +36,87 @@ class RRTPlaceOrderPage extends StatelessWidget {
onModelReady: (vm) => viewModel = vm, onModelReady: (vm) => viewModel = vm,
builder: (ctx, vm, wState) { builder: (ctx, vm, wState) {
return AppScaffold( return AppScaffold(
appBarTitle: localize.rapidResponseTeam, appBarTitle: localize.rapidResponseTeam,
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
body: Column( body: SingleChildScrollView(
padding: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Expanded( Text(
child: SingleChildScrollView( localize.selectedLocation,
padding: EdgeInsets.all(20), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.stretch, selectedAddressField(),
children: [ AspectRatio(
Text( aspectRatio: 3 / 1,
localize.selectedLocation, child: ClipRRect(
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18), clipBehavior: Clip.hardEdge,
), borderRadius: BorderRadius.circular(10),
selectedAddressField(), child: Image.network(
AspectRatio( "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",
aspectRatio: 3 / 1, fit: BoxFit.cover,
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),
),
)),
),
],
), ),
), ),
), ),
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 ?? ''}"; var address = "${selectedAddress.address1 ?? ''} ${selectedAddress.address2 ?? ''}";
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 10), margin: EdgeInsets.symmetric(vertical: 10),
child: Expanded( child: MaterialButton(
child: MaterialButton( height: 50,
height: 50, color: Colors.white,
color: Colors.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), onPressed: () {},
onPressed: () {}, child: Row(
child: Row( children: [
children: [ Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 15, letterSpacing: 1))),
Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 15, letterSpacing: 1))), Icon(
Icon( Icons.location_on_rounded,
Icons.location_on_rounded, size: 30,
size: 30, color: Colors.black,
color: Colors.black, )
) ],
],
),
), ),
), ),
); );
} }
Widget submitButton(BuildContext context) { Widget submitButton(BuildContext context) {
return Padding( return Container(
padding: const EdgeInsets.all(15), color: Theme.of(context).scaffoldBackgroundColor,
child: DefaultButton( child: Padding(
localize.submit, padding: const EdgeInsets.all(15),
() => placeOrder(), child: DefaultButton(
localize.submit,
() => placeOrder(),
),
), ),
); );
} }
@ -176,21 +167,34 @@ class RRTPlaceOrderPage extends StatelessWidget {
params['Latitude'] = latlng.latitude; params['Latitude'] = latlng.latitude;
params['Longitude'] = latlng.longitude; params['Longitude'] = latlng.longitude;
params['Notes'] = noteController.text; params['Notes'] = noteController.text;
// var response = await viewModel.createOrder(params);
var requestId = await viewModel.createOrder(params); var requestId = await viewModel.createOrder(params);
GifLoaderDialogUtils.hideDialog(_context); GifLoaderDialogUtils.hideDialog(_context);
if (requestId != null) { if (requestId != null) {
AlertDialogBox( showCMCConfirmDialog(
context: _context, _context,
title: '', requestId.toString(),
confirmMessage: localize.rrtOrderSuccessMessage, onClick: () {
okText: localize.ok, gotoRRTRoot();
okFunction: () { // Navigator.pop(_context);
AlertDialogBox.closeAlertDialog(_context); // Navigator.pop(_context);
gotoRRTRoot(); },
}).showAlertDialog(_context); );
} }
// if (requestId != null) {
// AlertDialogBox(
// context: _context,
// title: '',
// confirmMessage: localize.rrtOrderSuccessMessage,
// okText: localize.ok,
// okFunction: () {
// AlertDialogBox.closeAlertDialog(_context);
// gotoRRTRoot();
// }).showAlertDialog(_context);
// }
} else { } else {
AppToast.showErrorToast(message: 'Invalid location selected'); AppToast.showErrorToast(message: 'Invalid location selected');
} }

@ -1,10 +1,10 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.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-order-list-item.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-pickup-address-page.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/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/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -25,13 +25,10 @@ class RRTRequestPage extends StatefulWidget {
class RRTRequestPageState extends State<RRTRequestPage> { class RRTRequestPageState extends State<RRTRequestPage> {
bool acceptTerms = false; bool acceptTerms = false;
TranslationBase localize;
RRTViewModel viewModel; RRTViewModel viewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
localize = TranslationBase.of(context);
return BaseView<RRTViewModel>( return BaseView<RRTViewModel>(
onModelReady: (vm) { onModelReady: (vm) {
viewModel = vm; viewModel = vm;
@ -63,7 +60,8 @@ class RRTRequestPageState extends State<RRTRequestPage> {
Container( Container(
padding: EdgeInsets.only(top: 20, bottom: 5), padding: EdgeInsets.only(top: 20, bottom: 5),
alignment: Alignment.center, 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(), paymentOptions(),
], ],
@ -87,7 +85,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
Widget serviceDescription(BuildContext context) => Padding( Widget serviceDescription(BuildContext context) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 10), padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text( child: Text(
localize.rrtDDetails, TranslationBase.of(context).rrtDDetails,
textAlign: TextAlign.justify, textAlign: TextAlign.justify,
style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300), 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( Container(
height: 30, height: 30,
decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)), 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), 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), 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), Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
], ],
); );
@ -149,14 +147,19 @@ class RRTRequestPageState extends State<RRTRequestPage> {
setState(() => acceptTerms = v); setState(() => acceptTerms = v);
}), }),
SizedBox(width: 10), 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( Container(
alignment: Alignment.center, alignment: Alignment.center,
width: MediaQuery.of(context).size.width * 0.25, width: MediaQuery.of(context).size.width * 0.25,
child: TextButton( 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: () { onPressed: () {
Navigator.push(context, FadePage(page: RRTAgreementPage())); Navigator.push(
context,
FadePage(
page: UserAgreementContent(),
),
);
}), }),
) )
], ],
@ -184,7 +187,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
if (acceptTerms) if (acceptTerms)
goToPickupAddress(); goToPickupAddress();
else 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, //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, buttonTitle: TranslationBase.of(context).schedule,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg', buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
@ -136,7 +136,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
onTap: (index) { onTap: (index) {
setState(() { setState(() {
if (index == 1) { 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; _tabController.index = _tabController.previousIndex;
AppointmentDetails.showFooterButton = false; AppointmentDetails.showFooterButton = false;
} else { } else {
@ -147,7 +147,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
}, },
tabs: [ tabs: [
Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), 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( ? Tab(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
) )

@ -121,7 +121,8 @@ class _ToDoState extends State<ToDo> {
DateUtil.getWeekDayMonthDayYearDateFormatted( DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") + 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)), 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(), !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); print(value);
getPatientAppointmentHistory(); getPatientAppointmentHistory();

@ -2,11 +2,16 @@ import 'dart:io';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget { class PaymentMethod extends StatefulWidget {
Function onSelectedMethod;
PaymentMethod({this.onSelectedMethod});
@override @override
_PaymentMethodState createState() => _PaymentMethodState(); _PaymentMethodState createState() => _PaymentMethodState();
} }
@ -21,7 +26,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: SingleChildScrollView( child: SingleChildScrollView(
@ -33,154 +38,224 @@ class _PaymentMethodState extends State<PaymentMethod> {
Container( Container(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0), margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
alignment: Alignment.center, 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( Container(
margin: EdgeInsets.only(top: 25.0), width: double.infinity,
child: Flex( child: InkWell(
direction: Axis.horizontal, onTap: () {
children: <Widget>[ updateSelectedPaymentMethod("MADA");
Expanded( },
child: Container( child: Card(
child: InkWell( elevation: 3.0,
onTap: () { margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
updateSelectedPaymentMethod("MADA"); color: Colors.white,
}, shape: RoundedRectangleBorder(
child: Card( borderRadius: BorderRadius.circular(10),
elevation: 3.0, side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.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"),
),
),
),
),
), ),
Expanded( child: Row(
child: Container( children: [
child: InkWell( Container(
onTap: () { height: 60.0,
updateSelectedPaymentMethod("VISA"); width: 60,
}, padding: EdgeInsets.all(7.0),
child: Card( child: Image.asset("assets/images/new-design/mada.png"),
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"),
),
),
), ),
), mWidth(12),
Text(
"Mada",
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold,
),
)
],
), ),
], ),
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 25.0), width: double.infinity,
child: Flex( child: InkWell(
direction: Axis.horizontal, onTap: () {
children: <Widget>[ updateSelectedPaymentMethod("VISA");
Expanded( },
child: Container( child: Card(
child: InkWell( elevation: 3.0,
onTap: () { margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
updateSelectedPaymentMethod("MASTERCARD"); color: Colors.white,
}, shape: RoundedRectangleBorder(
child: Card( borderRadius: BorderRadius.circular(10),
elevation: 3.0, side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), ),
color: Colors.white, child: Row(
shape: RoundedRectangleBorder( children: [
borderRadius: BorderRadius.circular(10), Container(
side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), height: 60.0,
), padding: EdgeInsets.all(7.0),
child: Container( width: 60,
height: 120.0, child: Image.asset("assets/images/new-design/visa.png"),
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset("assets/images/new-design/mastercard.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: Row(
child: Container( children: [
child: InkWell( Container(
onTap: () { height: 60.0,
updateSelectedPaymentMethod("Installment"); padding: EdgeInsets.all(7.0),
}, width: 60,
child: Card( child: Image.asset("assets/images/new-design/mastercard.png"),
elevation: 3.0, ),
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), mWidth(12),
color: Colors.white, Text(
shape: RoundedRectangleBorder( "MasterCard",
borderRadius: BorderRadius.circular(10), style: TextStyle(
side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), color: Colors.black,
), fontSize: 14,
child: Container( fontWeight: FontWeight.bold,
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"),
),
), ),
)
],
),
),
),
),
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( Platform.isIOS
margin: EdgeInsets.only(top: 25.0), ? Container(
child: Flex( width: double.infinity,
direction: Axis.horizontal, child: InkWell(
children: <Widget>[ onTap: () {
Expanded( updateSelectedPaymentMethod("ApplePay");
child: Container( },
child: InkWell( child: Card(
onTap: () { elevation: 3.0,
updateSelectedPaymentMethod("ApplePay"); margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
}, color: Colors.white,
child: Card( shape: RoundedRectangleBorder(
elevation: 3.0, borderRadius: BorderRadius.circular(10),
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
color: Colors.white, ),
shape: RoundedRectangleBorder( child: Row(
borderRadius: BorderRadius.circular(10), children: [
side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), Container(
), height: 60.0,
child: Container( padding: EdgeInsets.all(7.0),
height: 120.0, width: 60,
padding: EdgeInsets.all(20.0), child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
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( // Container(
child: Container(), // margin: EdgeInsets.only(top: 25.0),
), // child: Flex(
], // direction: Axis.horizontal,
), // children: <Widget>[
) : Container(), // 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( SizedBox(
height: 150.0, height: 150.0,
), ),
@ -190,7 +265,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
padding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), padding: EdgeInsets.all(16),
color: Colors.white, color: Colors.white,
child: Container( child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
@ -208,7 +283,9 @@ class _PaymentMethodState extends State<PaymentMethod> {
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
elevation: 0,
onPressed: () { onPressed: () {
widget.onSelectedMethod(selectedPaymentMethod);
Navigator.pop(context, selectedPaymentMethod); Navigator.pop(context, selectedPaymentMethod);
}, },
child: Text(TranslationBase.of(context).confirm.toUpperCase(), 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), padding: const EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
navigateTo(context, MedicalProfilePageNew()); widget.onMedicalFileClick();
}, },
child: LoggedSliderView( child: LoggedSliderView(
projectViewModel, projectViewModel,

@ -233,13 +233,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
// signalRUtil = new SignalRUtil(hubName: "http://192.168.8.101:5001/chatHub", context: context); // 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); locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
familyFileProvider.getSharedRecordByStatus(); familyFileProvider.getSharedRecordByStatus();
} }
// signalRUtil.startSignalRConnection(); signalRUtil.startSignalRConnection();
}); });
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
//for now commented to reduce this call will enable it when needed //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/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.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/locator.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingRequest.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class LiveCareHome extends StatefulWidget { class LiveCareHome extends StatefulWidget {
static bool showFooterButton = true; static bool showFooterButton = true;
@ -30,7 +32,7 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
ErRequestHistoryList pendingERRequestHistoryList; ErRequestHistoryList pendingERRequestHistoryList;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -39,9 +41,9 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
pendingERRequestHistoryList = new ErRequestHistoryList(); pendingERRequestHistoryList = new ErRequestHistoryList();
imagesInfo.add(ImagesInfo( 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((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (!isDataLoaded && authenticatedUserObject.isLogin) getLiveCareHistory(); if (!isDataLoaded && projectViewModel.isLogin) getLiveCareHistory();
}); });
super.initState(); super.initState();
@ -49,6 +51,7 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).livecare, appBarTitle: TranslationBase.of(context).livecare,
isShowAppBar: true, isShowAppBar: true,

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; 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/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class LiveCareHistoryCard extends StatefulWidget { class LiveCareHistoryCard extends StatefulWidget {
ErRequestHistoryList erRequestHistoryList; ErRequestHistoryList erRequestHistoryList;
@ -24,6 +27,8 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
getAuthenticatedUser(); getAuthenticatedUser();
@ -32,6 +37,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
child: Card( child: Card(
@ -48,23 +54,14 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Text("Requested date:", Text(TranslationBase.of(context).requestedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
style:
TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 0.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Text(widget.erRequestHistoryList.sArrivalTime, Text(widget.erRequestHistoryList.sArrivalTime, style: TextStyle(fontSize: 14.0)),
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])),
Text(
"Call Duration\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, color: Colors.green,
), ),
margin: EdgeInsets.only(top: 5.0, bottom: 5.0), margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Text(widget.erRequestHistoryList.stringCallStatus, child: Text(widget.erRequestHistoryList.stringCallStatus, style: TextStyle(fontSize: 14.0, color: Colors.white)),
style: TextStyle(fontSize: 14.0, color: Colors.white)),
), ),
Divider( Divider(
color: Colors.grey[500], color: Colors.grey[500],
@ -90,17 +86,15 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
print("Invoice");
openInvoice(); openInvoice();
}, },
child: Container( child: Container(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Icon(Icons.content_paste, color: Colors.blue), Icon(Icons.content_paste, color: Colors.red),
Container( Container(
margin: EdgeInsets.only(left: 10.0), margin: EdgeInsets.only(left: 10.0),
child: Text("Invoice", child: Text(TranslationBase.of(context).invoice, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
textAlign: TextAlign.center),
), ),
], ],
), ),
@ -110,7 +104,6 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
print("Complaints");
openComplaint(); openComplaint();
}, },
child: Container( child: Container(
@ -119,8 +112,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
Icon(Icons.add, size: 24.0, color: Colors.red), Icon(Icons.add, size: 24.0, color: Colors.red),
Container( Container(
margin: EdgeInsets.only(left: 10.0), margin: EdgeInsets.only(left: 10.0),
child: Text("Complaints", child: Text(TranslationBase.of(context).complaint, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
textAlign: TextAlign.center),
), ),
], ],
), ),
@ -130,19 +122,16 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
print("Rate Dr & Appointment"); rateLiveCareAppo();
}, },
child: Container( child: Container(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Icon(Icons.star, Icon(Icons.star, size: 24.0, color: Colors.yellow[700]),
size: 24.0, color: Colors.yellow[700]),
Container( Container(
width: MediaQuery.of(context).size.width * 0.2, width: MediaQuery.of(context).size.width * 0.2,
margin: EdgeInsets.only(left: 10.0), margin: EdgeInsets.only(left: 10.0),
child: Text("Rate Dr & Appointment", child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
overflow: TextOverflow.clip,
textAlign: TextAlign.center),
), ),
], ],
), ),
@ -159,16 +148,25 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
); );
} }
rateLiveCareAppo() {
if(widget.erRequestHistoryList.isAppointmentHaveRating) {
AppToast.showErrorToast(message: TranslationBase.of(context).alreadyRated);
} else {
}
}
openInvoice() { openInvoice() {
ConfirmDialog dialog = new ConfirmDialog( showDialog(
context: context, context: context,
confirmMessage: "Send a copy of this invoice to the email: " + child: ConfirmSendEmailDialog(
authUser.emailAddress, email: projectViewModel.user.emailAddress,
okText: TranslationBase.of(context).confirm, onTapSendEmail: () {
cancelText: TranslationBase.of(context).cancel_nocaps, sendInvoiceEmail(context);
okFunction: () => {sendInvoiceEmail(context)}, },
cancelFunction: () => {}); ),
dialog.showAlertDialog(context); );
} }
openComplaint() { openComplaint() {
@ -176,17 +174,10 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
} }
sendInvoiceEmail(context) { sendInvoiceEmail(context) {
ConfirmDialog.closeAlertDialog(context);
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.sendLiveCareInvoiceEmail(widget.erRequestHistoryList.appointmentNo.toString(), widget.erRequestHistoryList.projectID, authUser.emailAddress, context).then((res) {
.sendLiveCareInvoiceEmail( AppToast.showSuccessToast(message: TranslationBase(context).emailSentSuccessfully);
widget.erRequestHistoryList.appointmentNo.toString(),
widget.erRequestHistoryList.projectID,
authUser.emailAddress,
context)
.then((res) {
AppToast.showSuccessToast(message: "LiveCare invoice sent successfully");
}).catchError((err) { }).catchError((err) {
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
print(err); print(err);
@ -195,8 +186,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
getAuthenticatedUser() async { getAuthenticatedUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
setState(() { setState(() {
authUser = data; authUser = data;
}); });

@ -78,6 +78,9 @@ class _clinic_listState extends State<ClinicList> {
print("LiveCare Type Selected"); print("LiveCare Type Selected");
setState(() { setState(() {
currentSelectedLiveCareType = "immediate"; currentSelectedLiveCareType = "immediate";
// isDataLoaded = true;
// print(liveCareOnlineClinicsListResponse.length);
getLiveCareClinicsList();
}); });
} }
}); });
@ -556,7 +559,7 @@ class _clinic_listState extends State<ClinicList> {
alignment: FractionalOffset.bottomCenter, alignment: FractionalOffset.bottomCenter,
child: Container( child: Container(
color: Colors.grey[100], 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, width: MediaQuery.of(context).size.width,
height: 50.0, height: 50.0,
margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 20.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 { loginWithFingurePrintFace(type, int isActive) async {
if (isActive == 1) { if (isActive == 1 || isActive ==0) {
// this.startBiometricLoginIfAvailable();
const iosStrings = const iosStrings =
const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'); const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID');
try { try {
authenticated = await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings); authenticated = await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings);
} on PlatformException catch (e) { } on PlatformException catch (e) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: 'Please enable your Touch or Face ID'); 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) { 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( return InkWell(
onTap: isDisable onTap: isDisable

@ -80,7 +80,7 @@ class DoctorHomePage extends StatelessWidget {
nationalityFlagURL: _doctorList.nationalityFlagURL); nationalityFlagURL: _doctorList.nationalityFlagURL);
return DoctorView( return DoctorView(
doctor: doctorList, doctor: doctorList,
isLiveCareAppointment: false, isLiveCareAppointment: _doctorList.isLiveCareClinic,
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),

@ -1,11 +1,15 @@
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; 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/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class PassportUpdatePage extends StatefulWidget { class PassportUpdatePage extends StatefulWidget {
@override @override
@ -15,6 +19,7 @@ class PassportUpdatePage extends StatefulWidget {
class _PassportUpdatePageState extends State<PassportUpdatePage> { class _PassportUpdatePageState extends State<PassportUpdatePage> {
TextEditingController passportNumber = new TextEditingController(); TextEditingController passportNumber = new TextEditingController();
bool _isButtonDisabled; bool _isButtonDisabled;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -24,60 +29,224 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).passportNumber, appBarTitle: TranslationBase.of(context).passportNumber,
isShowAppBar: true, isShowAppBar: true,
isBottomBar: true, isBottomBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container( body: Container(
child: SingleChildScrollView( child: Column(
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.center, Expanded(
children: [ child: SingleChildScrollView(
Container( child: Padding(
margin: EdgeInsets.all(45.0), padding: const EdgeInsets.all(12.0),
child: Text(TranslationBase.of(context).enterPassportNumber, textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, color: Colors.black)), 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), Container(
child: SvgPicture.asset("assets/images/new-design/passport.svg", width: 250.0, fit: BoxFit.fill), 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), Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
hintText: TranslationBase.of(context).passportNumber, return Container(
)), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
Container( alignment: Alignment.center,
margin: EdgeInsets.only(top: 30.0, left: 45.0, right: 45.0, bottom: 10.0), decoration: BoxDecoration(
child: ButtonTheme( borderRadius: BorderRadius.circular(15),
shape: RoundedRectangleBorder( color: Colors.white,
borderRadius: BorderRadius.circular(10.0), 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, TextField(
height: 45.0, enabled: isEnable,
child: RaisedButton( scrollPadding: EdgeInsets.zero,
color: new Color(0xFFc5272d), keyboardType: TextInputType.number,
textColor: Colors.white, controller: _controller,
disabledTextColor: Colors.white, onChanged: (value) => {_onPassportTextChanged(value)},
disabledColor: Colors.red[300], style: TextStyle(
onPressed: () { fontSize: 14,
if (_isButtonDisabled == false) height: 21 / 14,
updatePassportNumber(); fontWeight: FontWeight.w400,
else color: Color(0xff2B353E),
AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber); letterSpacing: -0.44,
}, ),
child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)), 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); GifLoaderDialogUtils.hideDialog(context);
print(res['Covid19_Certificate_GetPassportList'][0]['PassportNo']); print(res['Covid19_Certificate_GetPassportList'][0]['PassportNo']);
passportNumber.text = 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; _isButtonDisabled = false;
} }
}).catchError((err) { }).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/core/viewModels/vaccine_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.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/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -30,12 +31,13 @@ class _MyVaccinesState extends State<MyVaccines> {
onModelReady: (model) => model.getVaccine(), onModelReady: (model) => model.getVaccine(),
builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold( builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).myVaccines, appBarTitle: TranslationBase.of(context).myVaccines,
description: TranslationBase.of(context).infoVaccines, description: TranslationBase.of(context).infoVaccines,
imagesInfo: [ imagesInfo: [
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')
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( body: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -167,17 +169,41 @@ class _MyVaccinesState extends State<MyVaccines> {
if (projectViewModel.havePrivilege(27)) if (projectViewModel.havePrivilege(27))
Container( Container(
width: double.infinity, width: double.infinity,
// height: 80.0, child: DefaultButton(
child: SecondaryButton( TranslationBase.of(context).sendEmail,
label: TranslationBase.of(context).sendEmail, () {
color: Color(0xffF62426), showDialog(
textColor: Colors.white, context: context,
disabled: model.vaccineList.length == 0, child: ConfirmSendEmailDialog(
loading: model.state == ViewState.BusyLocal, email: projectViewModel.user.emailAddress,
onTap: () async { onTapSendEmail: () {
model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully); 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; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); request = {};
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
};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_COVID_DRIVETHRU_PROJECT_LIST, await baseAppClient.post(GET_COVID_DRIVETHRU_PROJECT_LIST, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -54,35 +38,18 @@ class CovidDriveThruService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
request = {};
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
};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_COVID_DRIVETHRU_PROCEDURES_LIST, await baseAppClient.post(GET_COVID_DRIVETHRU_PROCEDURES_LIST, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { throw error;
throw error; }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
@ -90,37 +57,22 @@ class CovidDriveThruService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"ProjectID": projectID, "ProjectID": projectID,
"ProcedureId": procedureID, "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
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_COVID_DRIVETHRU_PAYMENT_INFO, await baseAppClient.post(GET_COVID_DRIVETHRU_PAYMENT_INFO, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { throw error;
throw error; }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
@ -128,36 +80,21 @@ class CovidDriveThruService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"ProjectID": projectID, "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; dynamic localRes;
await baseAppClient.post(GET_COVID_DRIVETHRU_FREE_SLOTS, await baseAppClient.post(GET_COVID_DRIVETHRU_FREE_SLOTS, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { throw error;
throw error; }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
} }

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

@ -69,7 +69,9 @@ class TranslationBase {
String get enterDocName => localizedValues['enterDocName'][locale.languageCode]; String get enterDocName => localizedValues['enterDocName'][locale.languageCode];
String get search => localizedValues['search'][locale.languageCode]; String get search => localizedValues['search'][locale.languageCode];
String get noResultFound => localizedValues['noResultFound'][locale.languageCode]; String get noResultFound => localizedValues['noResultFound'][locale.languageCode];
String get pleaseEnterProductName => localizedValues['pleaseEnterProductName'][locale.languageCode]; String get pleaseEnterProductName => localizedValues['pleaseEnterProductName'][locale.languageCode];
String get bookNow => localizedValues['bookNow'][locale.languageCode]; String get bookNow => localizedValues['bookNow'][locale.languageCode];
@ -415,7 +417,9 @@ class TranslationBase {
String get sendEmail => localizedValues['sendEmail'][locale.languageCode]; String get sendEmail => localizedValues['sendEmail'][locale.languageCode];
String get close => localizedValues['close'][locale.languageCode]; String get close => localizedValues['close'][locale.languageCode];
String get closeIt => localizedValues['closeIt'][locale.languageCode]; String get closeIt => localizedValues['closeIt'][locale.languageCode];
String get booked => localizedValues['booked'][locale.languageCode]; String get booked => localizedValues['booked'][locale.languageCode];
String get confirmed => localizedValues['confirmed'][locale.languageCode]; String get confirmed => localizedValues['confirmed'][locale.languageCode];
@ -754,6 +758,10 @@ class TranslationBase {
String get save => localizedValues['Save'][locale.languageCode]; 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 userAgreement => localizedValues['UserAgreement'][locale.languageCode];
String get updateSuccessfully => localizedValues['UpdateSuccessfully'][locale.languageCode]; String get updateSuccessfully => localizedValues['UpdateSuccessfully'][locale.languageCode];
@ -810,6 +818,8 @@ class TranslationBase {
String get confirmThePayment => localizedValues['ConfirmThePayment'][locale.languageCode]; String get confirmThePayment => localizedValues['ConfirmThePayment'][locale.languageCode];
String get changePayment => localizedValues['changePayment'][locale.languageCode];
String get depositorName => localizedValues['DepositorName'][locale.languageCode]; String get depositorName => localizedValues['DepositorName'][locale.languageCode];
String get mobileNumber => localizedValues['MobileNumber'][locale.languageCode]; String get mobileNumber => localizedValues['MobileNumber'][locale.languageCode];
@ -907,16 +917,27 @@ class TranslationBase {
String get lakum => localizedValues['lakum'][locale.languageCode]; String get lakum => localizedValues['lakum'][locale.languageCode];
String get wishlist => localizedValues['wishlist'][locale.languageCode]; String get wishlist => localizedValues['wishlist'][locale.languageCode];
String get brands => localizedValues['brands'][locale.languageCode]; String get brands => localizedValues['brands'][locale.languageCode];
String get products => localizedValues['products'][locale.languageCode]; String get products => localizedValues['products'][locale.languageCode];
String get reviews => localizedValues['reviews'][locale.languageCode]; String get reviews => localizedValues['reviews'][locale.languageCode];
String get productDetails => localizedValues['productDetails'][locale.languageCode]; String get productDetails => localizedValues['productDetails'][locale.languageCode];
String get noReviewsAvailable => localizedValues['noReviewsAvailable'][locale.languageCode]; String get noReviewsAvailable => localizedValues['noReviewsAvailable'][locale.languageCode];
String get noLocationAvailable => localizedValues['noLocationAvailable'][locale.languageCode]; String get noLocationAvailable => localizedValues['noLocationAvailable'][locale.languageCode];
String get myPrescriptions => localizedValues['myPrescriptions'][locale.languageCode]; String get myPrescriptions => localizedValues['myPrescriptions'][locale.languageCode];
String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode]; String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode];
String get pillReminder => localizedValues['pillReminder'][locale.languageCode]; String get pillReminder => localizedValues['pillReminder'][locale.languageCode];
String get shippingAddresses => localizedValues['shippingAddresses'][locale.languageCode]; String get shippingAddresses => localizedValues['shippingAddresses'][locale.languageCode];
String get reachUs => localizedValues['reachUs'][locale.languageCode]; String get reachUs => localizedValues['reachUs'][locale.languageCode];
String get ourLocations => localizedValues['ourLocations'][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 yearOld => localizedValues['years-old'][locale.languageCode];
String get categorise => localizedValues['categorise'][locale.languageCode]; String get categorise => localizedValues['categorise'][locale.languageCode];
String get refine => localizedValues['refine'][locale.languageCode]; String get refine => localizedValues['refine'][locale.languageCode];
String get apply => localizedValues['apply'][locale.languageCode]; String get apply => localizedValues['apply'][locale.languageCode];
String get reset => localizedValues['reset'][locale.languageCode]; String get reset => localizedValues['reset'][locale.languageCode];
String get viewCategorise => localizedValues['viewCategorise'][locale.languageCode]; String get viewCategorise => localizedValues['viewCategorise'][locale.languageCode];
String get cart => localizedValues['cart'][locale.languageCode]; String get cart => localizedValues['cart'][locale.languageCode];
String get wishList => localizedValues['wishList'][locale.languageCode]; String get wishList => localizedValues['wishList'][locale.languageCode];
@ -1744,10 +1770,15 @@ class TranslationBase {
String get quantitySize => localizedValues['quantitySize'][locale.languageCode]; String get quantitySize => localizedValues['quantitySize'][locale.languageCode];
String get addToCart => localizedValues['addToCart'][locale.languageCode]; String get addToCart => localizedValues['addToCart'][locale.languageCode];
String get addToWishlist => localizedValues['addToWishlist'][locale.languageCode]; String get addToWishlist => localizedValues['addToWishlist'][locale.languageCode];
String get buyNow => localizedValues['buyNow'][locale.languageCode]; String get buyNow => localizedValues['buyNow'][locale.languageCode];
String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode]; String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode];
String get noData => localizedValues['noData'][locale.languageCode]; String get noData => localizedValues['noData'][locale.languageCode];
String get no_data => localizedValues['no_data'][locale.languageCode]; String get no_data => localizedValues['no_data'][locale.languageCode];
String get year => localizedValues['Year'][locale.languageCode]; String get year => localizedValues['Year'][locale.languageCode];
@ -2260,7 +2291,21 @@ class TranslationBase {
String get emptySchedule => localizedValues["emptySchedule"][locale.languageCode]; String get emptySchedule => localizedValues["emptySchedule"][locale.languageCode];
String get serviceNotAvailable => localizedValues["serviceNotAvailable"][locale.languageCode]; String get serviceNotAvailable => localizedValues["serviceNotAvailable"][locale.languageCode];
String get doctorScheduleNot => localizedValues["doctorScheduleNot"][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> { 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:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -462,7 +460,9 @@ class Utils {
if (projectViewModel.isLogin && userData_ != null) { if (projectViewModel.isLogin && userData_ != null) {
String patientID = userData_.patientID.toString(); String patientID = userData_.patientID.toString();
GifLoaderDialogUtils.showMyDialog(context); 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 { } else {
AlertDialogBox( AlertDialogBox(
context: context, 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)), MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)),
)); ));
return medical; return medical;
} }
@ -632,11 +631,12 @@ class Utils {
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
), ),
SizedBox(height: 5), SizedBox(height: 5),
if(showDivider) Divider( if (showDivider)
height: 1, Divider(
color: Color(0xff2E303A), height: 1,
thickness: 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( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xff2B353E), color: onRatingAndReviewTap != null ? Colors.blue[600] : Color(0xff2B353E),
letterSpacing: -0.48, letterSpacing: -0.48,
height: 18 / 12, height: 18 / 12,
decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null, decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null,

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

Loading…
Cancel
Save