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,11 +42,12 @@ 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(),
padding: EdgeInsets.all(21),
child: Column( child: Column(
children: [ children: [
ListView.separated( ListView.separated(
@ -100,71 +102,61 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
return mDivider(Colors.grey); return mDivider(Colors.grey);
}, },
itemCount: widget.model.cmcAllServicesList.length), itemCount: widget.model.cmcAllServicesList.length),
Card( Image.asset(projectViewModel.isArabic?"assets/images/cc_ar.png":"assets/images/cc_en.png",width: double.infinity,),
shape: cardRadius(12), // Card(
elevation: 4, // shape: cardRadius(12),
child: Container( // elevation: 4,
width: double.infinity, // child: Container(
child: Column( // width: double.infinity,
crossAxisAlignment: CrossAxisAlignment.start, // child: Column(
children: [ // crossAxisAlignment: CrossAxisAlignment.start,
Padding( // children: [
padding: const EdgeInsets.only(left: 12,right: 12,top: 12), // Padding(
child: Text( // padding: const EdgeInsets.only(left: 12, right: 12, top: 12),
TranslationBase.of(context).coveredService, // child: Text(
style: TextStyle( // TranslationBase.of(context).coveredService,
fontSize: 14, // style: TextStyle(
fontWeight: FontWeight.w600, // fontSize: 14,
letterSpacing: -0.45, // fontWeight: FontWeight.w600,
), // letterSpacing: -0.45,
), // ),
), // ),
ListView.separated( // ),
itemBuilder: (context, index) { // ListView.separated(
return Padding( // itemBuilder: (context, index) {
padding: const EdgeInsets.all(12.0), // return Padding(
child: Text( // padding: const EdgeInsets.all(12.0),
widget.model.checkupItems[index].itemName, // child: Text(
style: TextStyle( // widget.model.checkupItems[index].itemName,
fontSize: 12, // style: TextStyle(
fontWeight: FontWeight.w600, // fontSize: 12,
letterSpacing: -0.45, // fontWeight: FontWeight.w600,
), // letterSpacing: -0.45,
), // ),
); // ),
}, // );
separatorBuilder: (context, index) { // },
return mDivider(Colors.grey); // separatorBuilder: (context, index) {
}, // return mDivider(Colors.grey);
physics: NeverScrollableScrollPhysics(), // },
shrinkWrap: true, // physics: NeverScrollableScrollPhysics(),
itemCount: widget.model.checkupItems.length, // shrinkWrap: true,
), // itemCount: widget.model.checkupItems.length,
], // ),
), // ],
), // ),
), // ),
mHeight(MediaQuery.of(context).size.height * 0.12), // ),
], ],
), ),
), ),
), ),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
color: CustomColors.appBackgroudGreyColor,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container( Container(
width: MediaQuery.of(context).size.width * 0.9, color: Colors.white,
child: SecondaryButton( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
label: TranslationBase.of(context).next, child: DefaultButton(
textColor: Theme.of(context).backgroundColor, TranslationBase.of(context).next,
color: CustomColors.accentColor, () async {
onTap: () async {
if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length != 0 || widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList == null) { if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length != 0 || widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList == null) {
int index = widget.model.cmcAllServicesList.length; int index = widget.model.cmcAllServicesList.length;
PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
@ -181,7 +173,9 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
if (widget.model.state == ViewState.ErrorLocal) { if (widget.model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(); Utils.showErrorToast();
} else { } else {
navigateTo(context,NewCMCStepTowPage( navigateTo(
context,
NewCMCStepTowPage(
longitude: widget.longitude, longitude: widget.longitude,
latitude: widget.latitude, latitude: widget.latitude,
cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel, cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel,
@ -195,7 +189,6 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
), ),
], ],
), ),
),
); );
} }
} }

@ -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,
width: double.infinity,
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController, controller: _tabController,
indicatorWeight: 3.0, indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: CustomColors.accentColor, labelColor: Color(0xff2B353E),
labelColor: Colors.black, unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
unselectedLabelColor: Colors.grey[800], labelStyle: TextStyle(
tabs: [ fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
Center( fontSize: 16,
child: Text(
TranslationBase.of(context).comprehensiveMedicalCheckup,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.34, letterSpacing: -0.48,
), ),
), unselectedLabelStyle: TextStyle(
), fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
Center( fontSize: 16,
child: Text(
TranslationBase.of(context).orderLog,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.34, 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';
@ -38,221 +41,135 @@ class OrdersLogDetailsPage extends StatelessWidget {
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) {
//processing
_color = Color(0xff2E303A);
} else if (status == 3) {
//completed
_color = Color(0xff359846);
} else if (status == 4) {
//cancel // Rejected
_color = Color(0xffD02127);
}
return Container( return Container(
width: double.infinity,
margin: EdgeInsets.only(top: 12),
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(border: Border.all(color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 6,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(left: 15, bottom: 15, top: 8, right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( color: _color,
bottom: BorderSide( borderRadius: BorderRadius.all(
color: Colors.grey, Radius.circular(10.0),
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,
), ),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
), ),
], ],
), ),
), child: Container(
Container( // decoration: containerColorRadiusLeft(Colors.white, 12),
width: double.infinity, margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( color: Colors.white,
bottom: BorderSide( border: Border.all(color: Colors.white, width: 1),
color: Colors.grey, borderRadius: BorderRadius.only(
width: 1.0, 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),
), ),
// borderRadius: BorderRadius.circular(12),
), ),
// clipBehavior: Clip.antiAlias,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).OrderStatus, _statusDisp,
style: TextStyle( style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
fontSize: 13,
fontWeight: FontWeight.w600,
letterSpacing: -0.45,
),
),
SizedBox(
height: 4,
), ),
SizedBox(height: 6),
Text( Text(
projectViewModel.isArabic ? order.descriptionN : order.description, '${TranslationBase.of(context).requestID}: ${order.iD}',
style: TextStyle( style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
fontSize: 18,
fontWeight: FontWeight.w600,
letterSpacing: -0.45,
),
), ),
], Row(
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).pickupDate, TranslationBase.of(context).serviceName + ": ",
style: TextStyle( style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
fontSize: 13,
fontWeight: FontWeight.w600,
letterSpacing: -0.45,
), ),
), Expanded(
SizedBox( child: Text(
height: 4, !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)),
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
letterSpacing: -0.45,
), ),
), ),
], ],
)
],
), ),
), ),
Container( Column(
width: double.infinity, mainAxisAlignment: MainAxisAlignment.spaceBetween,
clipBehavior: Clip.antiAlias, crossAxisAlignment: CrossAxisAlignment.end,
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: [ children: [
Text( Text(
TranslationBase.of(context).orderLocation, DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic),
style: TextStyle( style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
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,
),
),
],
), ),
), SizedBox(height: 12),
(order.status == 1 || order.status == 2)
? SizedBox(
height: 12,
)
: Container(),
if (order.status == 1 || order.status == 2) if (order.status == 1 || order.status == 2)
Center( InkWell(
child: Container(
width: MediaQuery.of(context).size.width * 0.85,
child: SecondaryButton(
label: TranslationBase.of(context).cancel.toUpperCase(),
onTap: () { onTap: () {
showConfirmMessage(model, order); showConfirmMessage(model, order);
}, },
color: Colors.red[800], child: Container(
disabled: false, padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
textColor: Theme.of(context).backgroundColor), 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),
), ),
(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,85 +44,62 @@ 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(),
child: Container(
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.05, right: MediaQuery.of(context).size.width * 0.05),
child: Center(
child: FractionallySizedBox(
widthFactor: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// Texts( Expanded(
// TranslationBase.of(context).selectHomeHealthCareServices, child: ListView.separated(
// textAlign: TextAlign.center, physics: BouncingScrollPhysics(),
// ), padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12),
Column( itemBuilder: (context, index) {
children: widget.model.hhcAllServicesList.map((service) { HHCGetAllServicesResponseModel service = widget.model.hhcAllServicesList[index];
return Container(
margin: EdgeInsets.only(top: 10), return Padding(
decoration: BoxDecoration( padding: const EdgeInsets.only(top: 4, bottom: 4),
// border: Border.all(color: Colors.grey, width: 1), child: Row(
borderRadius: BorderRadius.circular(12),
),
child: Column(
children: [
Row(
children: [ children: [
Checkbox( Checkbox(
value: isServiceSelected(service.serviceID), value: isServiceSelected(service.serviceID),
activeColor: Colors.red[800], activeColor: Color(0xffD02127),
tristate: false, tristate: false,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onChanged: (bool newValue) { onChanged: (bool newValue) {
setState(() { setState(() {
if (!isServiceSelected(service.serviceID)) if (!isServiceSelected(service.serviceID))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList( widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList(
recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length, recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length, serviceID: service.serviceID, serviceName: service.description));
serviceID: service.serviceID,
serviceName: service.description));
else else
removeSelected(service.serviceID); removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel // widget.patientERInsertPresOrderRequestModel
// isPatientInsured = newValue; // isPatientInsured = newValue;
}); });
}), }),
SizedBox(width: 6),
Expanded( Expanded(
child: Padding( child: Text(
padding: const EdgeInsets.only(left: 0.0, right: 10),
child: Texts(
projectViewModel.isArabic ? service.descriptionN : service.description.toLowerCase()?.capitalize(), projectViewModel.isArabic ? service.descriptionN : service.description.toLowerCase()?.capitalize(),
fontSize: 15, maxLines: 1,
style: 'letterSpacing: -0.48', overflow: TextOverflow.ellipsis,
fontWeight: FontWeight.bold, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
),
), ),
), ),
], ],
), ),
Divider(
height: 1,
color: Colors.grey,
)
],
),
); );
}).toList(), },
), separatorBuilder: (context, index) => Divider(
SizedBox(height: 70) height: 1,
], color: Color(0xffE5E5E5),
), ),
), itemCount: widget.model.hhcAllServicesList.length),
), ),
), Container(
), color: Colors.white,
bottomSheet: Container( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
width: MediaQuery.of(context).size.width, child: DefaultButton(
height: 70.0, TranslationBase.of(context).next,
color: Theme.of(context).scaffoldBackgroundColor, (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal)
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), ? null
child: Button( : () async {
onTap: () async {
widget.model.setState(ViewState.Busy); widget.model.setState(ViewState.Busy);
await widget.model.getCustomerInfo(); await widget.model.getCustomerInfo();
if (widget.model.state == ViewState.ErrorLocal) { if (widget.model.state == ViewState.ErrorLocal) {
@ -137,12 +116,12 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
); );
} }
}, },
label: TranslationBase.of(context).next, textColor: (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal) ? Color(0xff000000) : Colors.white,
backgroundColor: (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal) ? Colors.grey : Colors.red[900], disabledColor: Color(0xffEAEAEA),
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,51 +48,29 @@ 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,
appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0),
child: Stack(
children: <Widget>[ children: <Widget>[
Center( TabBar(
child: Center(
child: TabBar(
isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800], labelColor: Color(0xff2B353E),
labelColor: Theme.of(context).primaryColor, unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
unselectedLabelColor: Colors.grey[800], labelStyle: TextStyle(
tabs: [ fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
Container( fontSize: 16,
width: MediaQuery.of(context).size.width * 0.37, fontWeight: FontWeight.w600,
child: Center( letterSpacing: -0.48,
child: Texts( ),
TranslationBase.of(context).homeHealthCare, unselectedLabelStyle: TextStyle(
color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
), fontSize: 16,
), fontWeight: FontWeight.w600,
), letterSpacing: -0.48,
Container( ),
width: MediaQuery.of(context).size.width * 0.37, tabs: [Text(TranslationBase.of(context).homeHealthCare), Text(TranslationBase.of(context).orderLog)],
child: Center(
child: Texts(
TranslationBase.of(context).orderLog,
color: Colors.black,
),
),
),
],
), ),
),
),
],
),
),
body: Column(
children: <Widget>[
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -107,7 +88,6 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage> with SingleTick
], ],
), ),
), ),
),
); );
} }
} }

@ -42,127 +42,135 @@ class OrdersLogDetailsPage extends StatelessWidget {
// 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) {
//processing
_color = Color(0xff2E303A);
} else if (status == 3) {
//completed
_color = Color(0xff359846);
} else if (status == 4) {
//cancel // Rejected
_color = Color(0xffD02127);
}
return Container( return Container(
// margin: EdgeInsets.all(10), decoration: BoxDecoration(
child: Container( color: _color,
width: double.infinity, borderRadius: BorderRadius.all(
padding: EdgeInsets.only(left: 12, right: 12, top: 12), Radius.circular(10.0),
child: Card( ),
shape: cardRadius(12), boxShadow: [
elevation: 2, BoxShadow(
margin: EdgeInsets.zero, color: Color(0xff000000).withOpacity(.05),
color: order.status == 4 blurRadius: 27,
? Colors.red[900] offset: Offset(0, -3),
: order.status == 3 ),
? Colors.green[400] ],
: Color(0xffcd9e1b), ),
clipBehavior: Clip.antiAlias,
child: Container( child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12), // decoration: containerColorRadiusLeft(Colors.white, 12),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0), margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.all(12), padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
// color: Colors.white,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white, color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
), ),
), ),
// clipBehavior: Clip.antiAlias, // clipBehavior: Clip.antiAlias,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).OrderStatus + ' ' + (projectViewModel.isArabic ? order.descriptionN : order.description), _statusDisp,
bold: false, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
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( 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: [
Texts( Text(
TranslationBase.of(context).orderLocation, TranslationBase.of(context).serviceName + ": ",
bold: false, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
fontSize: 13,
), ),
SizedBox( Expanded(
height: 4, child: Text(
!projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
Texts(
!projectViewModel.isArabic ? order.nearestProjectDescription.toString() : order.nearestProjectDescriptionN.toString(),
fontSize: 13,
), ),
], ],
) )
], ],
)), ),
),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Texts( Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic),
fontSize: 14, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 8), SizedBox(height: 12),
(order.status == 1 || order.status == 2) if (order.status == 1 || order.status == 2)
? SecondaryButton( InkWell(
onTap: () { onTap: () {
showConfirmMessage(model, order); showConfirmMessage(model, order);
}, },
label: TranslationBase.of(context).cancel, child: Container(
color: Colors.red[900], padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
small: true, decoration: BoxDecoration(
) color: Color(0xffD02127),
: SizedBox() 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),
), ),
],
))),
));
}).toList())
],
), ),
), ),
],
), ),
],
), ),
), ),
); );
},
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,60 +120,51 @@ 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,
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
height: 150.0, child: Column(
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, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Text(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0), TranslationBase.of(context).selectAppo,
child: Text(TranslationBase.of(context).covidTest, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 24.0)), style: TextStyle(
), color: Colors.black,
Container( fontSize: 16.0,
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 10.0), letterSpacing: -0.64,
child: Text(TranslationBase.of(context).driveThru, style: TextStyle(color: Colors.white, fontSize: 24.0)), fontWeight: FontWeight.w600,
), ),
],
), ),
], Card(
shape: cardRadius(12),
child: _buildTableCalendarWithBuilders(projectViewModel),
), ),
mHeight(12),
Text(
selectedDate,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
), ),
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
_buildTableCalendarWithBuilders(projectViewModel),
Padding(
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
), ),
mHeight(8),
Container( Container(
height: 40, height: 40,
child: ListView.builder( child: ListView.builder(
@ -181,7 +173,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
itemCount: dayEvents.length, itemCount: dayEvents.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5), margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 0 : 5.0, left: index == 0 ? 0 : 5),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
@ -191,7 +183,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
width: 1.5, //width of the border width: 1.5, //width of the border
), ),
), ),
minWidth: MediaQuery.of(context).size.width * 0.18, minWidth: MediaQuery.of(context).size.width * 0.2,
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)), child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
); );
}, },
@ -201,34 +193,53 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
), ),
), ),
SizedBox( SizedBox(
height: 10.0, height: 100.0,
), ),
if (CovidTimeSlots.areSlotsAvailable) ],
Container( ),
color: Colors.grey[100], ),
margin: EdgeInsets.all(10.0), ),
child: DefaultButton( ),
TranslationBase.of(context).bookNow, Card(
() { elevation: 20,
margin: EdgeInsets.zero,
shape: cardRadius(0),
child: Container(
width: double.infinity,
padding: EdgeInsets.all(12),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: CustomColors.green,
textColor: Colors.white,
disabledTextColor: Colors.white,
elevation: 0,
disabledColor: Colors.grey[500],
onPressed: () {
bookCovidTestAppointment(); 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),
margin: EdgeInsets.all(16),
clipBehavior: Clip.antiAlias,
child: Padding(
padding: const EdgeInsets.only(bottom: 12),
child: TableCalendar(
locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US', locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US',
calendarController: _calendarController, calendarController: _calendarController,
events: _events, events: _events,
@ -258,7 +269,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
child: Container( child: Container(
margin: const EdgeInsets.all(4.0), margin: const EdgeInsets.all(4.0),
padding: const EdgeInsets.only(top: 5.0, left: 5.0), padding: const EdgeInsets.only(top: 5.0, left: 6.0),
color: Colors.transparent, color: Colors.transparent,
width: 0, width: 0,
height: 0, height: 0,
@ -314,8 +325,6 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
}, },
onVisibleDaysChanged: _onVisibleDaysChanged, onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated, 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,6 +372,15 @@ 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
@ -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 " +
projectViewModel.user.firstName +
" " +
projectViewModel.user.lastName +
", Having file number " +
projectViewModel.user.patientID.toString() +
". Please confirm!";
var messageAr =
"يتم حجز هذا الموعد المراجع " + projectViewModel.user.firstName + " " + projectViewModel.user.lastName + ", وجود رقم الملف " + projectViewModel.user.patientID.toString() + ". يرجى تأكيد!";
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: projectViewModel.isArabic ? messageAr : messageEn,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorList docObject = new DoctorList(); DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID; docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID; docObject.clinicID = widget.selectedClinicID;
docObject.projectID = widget.projectID; docObject.projectID = widget.projectID;
insertAppointmentCovidTest(context, docObject); 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,53 +37,132 @@ 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(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.9, width: double.infinity,
decoration: BoxDecoration( child: Card(
color: Colors.white, shape: cardRadius(12),
borderRadius: BorderRadius.circular(15.0), margin: EdgeInsets.zero,
), child: Padding(
margin: EdgeInsets.fromLTRB(18.0, 10.0, 18.0, 10.0), padding: const EdgeInsets.all(12.0),
padding: EdgeInsets.fromLTRB(8.0, 10.0, 8.0, 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(TranslationBase.of(context).covidBookAppo, style: TextStyle(fontSize: 18, letterSpacing: 1, fontWeight: FontWeight.bold)), Text(
Text(TranslationBase.of(context).patientName.toString() + ": " + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, style: TextStyle(fontSize: 14, letterSpacing: 1)), TranslationBase.of(context).covidBookAppo,
Text(TranslationBase.of(context).fileNo.toString() + ": " + projectViewModel.user.patientID.toString(), style: TextStyle(fontSize: 14, letterSpacing: 1)), 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,
), ),
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( mWidth(3),
child: ListView.separated( Text(
padding: EdgeInsets.symmetric(horizontal: 20), 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, itemCount: qa.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, idx) { itemBuilder: (ctx, idx) {
var obj = qa[idx]; var obj = qa[idx];
var qtext = isArabic ? obj["questionAR"] : obj["questionEN"]; var qtext = isArabic ? obj["questionAR"] : obj["questionEN"];
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 10), 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)), Text(
qtext,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
Row( Row(
children: [
Expanded(
child: Row(
children: [ children: [
Radio<int>( Radio<int>(
value: 1, value: 1,
@ -93,10 +172,19 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
obj["ans"] = newValue; obj["ans"] = newValue;
}); });
}), }),
Text(TranslationBase.of(context).yes), Text(
localize.yes,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
], ],
), ),
Row( ),
Expanded(
child: Row(
children: [ children: [
Radio<int>( Radio<int>(
value: 0, value: 0,
@ -106,22 +194,55 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
obj["ans"] = newValue; obj["ans"] = newValue;
}); });
}), }),
Text(TranslationBase.of(context).no), Text(
localize.no,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
], ],
),
) )
], ],
), ),
],
),
); );
}, },
separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)), separatorBuilder: (ctx, idx) => Container(),
)), ),
Padding( ],
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), ),
),
),
),
Card(
margin: EdgeInsets.zero,
elevation: 20,
child: Container(
padding: EdgeInsets.all(12),
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 1, widthFactor: 1,
child: DefaultButton(TranslationBase.of(context).next, () { child: MaterialButton(
next(); 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,7 +221,10 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
), ),
), ),
), ),
Container( Card(
elevation: 20,
margin: EdgeInsets.zero,
child: Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
child: ButtonTheme( child: ButtonTheme(
@ -232,6 +238,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: CustomColors.accentColor, disabledColor: CustomColors.accentColor,
elevation: 0,
onPressed: () { onPressed: () {
next(); next();
}, },
@ -245,6 +252,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
), ),
), ),
)), )),
),
], ],
), ),
); );
@ -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,266 +31,190 @@ 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,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
height: 180.0,
color: new Color(0xFFc5272d), color: new Color(0xFFc5272d),
padding: EdgeInsets.all(20),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Container( Icon(
margin: EdgeInsets.only(left: 50.0), Icons.warning_outlined,
child: SvgPicture.asset(
'assets/images/new-design/alert_icon.svg',
width: 80.0,
height: 80.0),
),
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 30.0, right: 20.0),
child: Text(TranslationBase.of(context).covidAlert,
style: TextStyle(
color: Colors.white, 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",
overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(
color: Colors.white, fontSize: 20.0)), color: Colors.white,
), fontWeight: FontWeight.w600,
], fontSize: 16.0,
letterSpacing: -0.64,
), ),
), ),
)
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 15.0), margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Text(
alignment: Alignment.center, TranslationBase.of(context).covidAlertMins,
child: Text(TranslationBase.of(context).covidAlertMins,
overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(
color: new Color(0xFFc5272d), fontSize: 19.0,
fontSize: 24.0, letterSpacing: -1.6,
fontWeight: FontWeight.bold)), fontWeight: FontWeight.bold,
), ),
Container( ),
alignment: Alignment.center, Text(
margin: EdgeInsets.only(top: 5.0),
child: Text(
TranslationBase.of(context).covidAlertInfo, TranslationBase.of(context).covidAlertInfo,
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.grey[700], color: Colors.grey[700],
fontSize: 18.0, fontSize: 14.0,
letterSpacing: 0.8)), letterSpacing: -0.56,
), ),
Container(
margin: EdgeInsets.only(
top: 20.0, bottom: 10.0, left: 0.0, right: 20.0),
child: Text(TranslationBase.of(context).appoInfo,
style: TextStyle(
fontSize: 18.0,
color: Colors.grey[700],
fontWeight: FontWeight.bold)),
), ),
mHeight(20),
Container( Container(
margin: EdgeInsets.only(left: 0.0, bottom: 20.0), width: double.infinity,
width: MediaQuery.of(context).size.width, child: Card(
decoration: BoxDecoration( margin: EdgeInsets.zero,
borderRadius: BorderRadius.circular(10), shape: cardRadius(12),
color: Colors.grey[200], child: Padding(
boxShadow: [ padding: const EdgeInsets.all(12.0),
BoxShadow(color: Colors.grey, spreadRadius: 2),
],
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Container( Text(
margin: EdgeInsets.only( TranslationBase.of(context).appoInfo,
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(TranslationBase.of(context).covidTest,
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 16.0,
color: Colors.black, letterSpacing: -0.64,
fontWeight: FontWeight.bold)), fontWeight: FontWeight.bold,
), ),
Container( ),
margin: EdgeInsets.only(bottom: 10.0), mHeight(16),
child: Row( Row(
children: <Widget>[ children: [
Container( _getNormalText(
margin: TranslationBase.of(context).hospital + ":",
EdgeInsets.only(left: 20.0, right: 20.0), ),
child: Icon( mWidth(6),
Icons.local_hospital, _getNormalText(
size: 24, widget.patientShareResponse.projectName != null ? widget.patientShareResponse.projectName : "NULL",
color: Colors.grey[700], isBold: true,
)),
Container(
child: Text(
widget.patientShareResponse.projectName !=
null
? widget
.patientShareResponse.projectName
: "NULL",
style: TextStyle(
fontSize: 18.0,
color: Colors.grey[700])),
), ),
], ],
), ),
mHeight(4),
Row(
children: [
_getNormalText(
TranslationBase.of(context).date + ":",
), ),
Container( mWidth(6),
margin: EdgeInsets.only(bottom: 10.0), _getNormalText(
child: Row( widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[0] : "NULL",
children: <Widget>[ isBold: true,
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])),
), ),
], ],
), ),
mHeight(4),
Row(
children: [
_getNormalText(
TranslationBase.of(context).time + ":",
), ),
Container( mWidth(6),
margin: EdgeInsets.only(bottom: 10.0), _getNormalText(
child: Row( widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[1] : "NULL",
children: <Widget>[ isBold: true,
Container(
margin:
EdgeInsets.only(left: 20.0, right: 20.0),
child: Icon(
Icons.access_time,
size: 24,
color: Colors.grey[700],
)),
Container(
child: Text(
widget.patientShareResponse
.appointmentDate !=
null
? getDate(widget.patientShareResponse
.appointmentDate)
.split(" ")[1]
: "NULL",
style: TextStyle(
fontSize: 18.0,
color: Colors.grey[700])),
), ),
], ],
), ),
mHeight(4),
Row(
children: [
_getNormalText(
TranslationBase.of(context).route + ":",
), ),
Container( mWidth(6),
margin: EdgeInsets.only(bottom: 10.0), _getNormalText(
child: Row( widget.patientShareResponse.doctorNameObj != null ? widget.patientShareResponse.doctorNameObj : "NULL",
children: <Widget>[ isBold: true,
Container( ),
margin: ],
EdgeInsets.only(left: 20.0, right: 20.0),
child: SvgPicture.asset(
"assets/images/new-design/track_icon.svg",
width: 20.0,
height: 20.0)),
Container(
child: Text(
widget.patientShareResponse.doctorNameObj !=
null
? widget
.patientShareResponse.doctorNameObj
: "NULL",
style: TextStyle(
fontSize: 18.0,
color: Colors.grey[700])),
), ),
], ],
), ),
), ),
),
),
], ],
), ),
), ),
], ],
), ),
), ),
Container( ),
margin: EdgeInsets.all(20.0), Card(
child: DefaultButton( margin: EdgeInsets.zero,
TranslationBase.of(context).next, elevation: 20,
() { child: Container(
margin: EdgeInsets.all(12),
width: double.infinity,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: CustomColors.accentColor,
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
elevation: 0,
onPressed: () {
startPaymentProcess(); 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(
context, FadePage(page: PaymentMethod()))
.then((value) {
print(value);
if (value != null) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: CovidPaymentSummary( page: CovidPaymentSummary(patientShareResponse: widget.patientShareResponse, selectedPaymentMethod: "MADA"),
patientShareResponse: widget.patientShareResponse,
selectedPaymentMethod: value.toString()),
), ),
); );
} // Navigator.push(context, FadePage(page: PaymentMethod())).then((value) {
}); // print(value);
// if (value != null) {
// Navigator.push(
// context,
// FadePage(
// page: CovidPaymentSummary(patientShareResponse: widget.patientShareResponse, selectedPaymentMethod: value.toString()),
// ),
// );
// }
// });
} }
String getDate(String appoDate) { 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(
// margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: <Widget>[ Expanded(
Container( child: Padding(
height: 150.0, padding: EdgeInsets.all(16),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/new-design/covid-19-big-banner-bg.png"),
fit: BoxFit.fill,
),
color: Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(Radius.circular(10))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 90.0, height: 90.0),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
child: Text(TranslationBase.of(context).covidTest, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 24.0)),
),
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 10.0),
child: Text(TranslationBase.of(context).driveThru, style: TextStyle(color: Colors.white, fontSize: 24.0)),
),
],
),
],
),
),
Container(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0), color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0),
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,33 +149,72 @@ 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( Container(
alignment: Alignment.center, width: double.infinity,
margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 0.0), padding: EdgeInsets.only(top: 10, bottom: 3),
child: Text(TranslationBase.of(context).testFee, style: TextStyle(color: Colors.black, fontSize: 22.0, fontWeight: FontWeight.bold)), child: Row(
children: [
Expanded(
child: _getNormalText(TranslationBase.of(context).patientShareToDo),
),
Expanded(
child: _getNormalText(widget.covidPaymentInfoResponse.patientShareField.toString(), isBold: true),
)
],
),
), ),
Table( mDivider(Colors.grey[200]),
Container(
width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3),
child: Row(
children: [ children: [
TableRow(children: [ Expanded(
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)), child: _getNormalText(TranslationBase.of(context).patientTaxToDo),
TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientShareField.toString())), ),
]), Expanded(
TableRow(children: [ child: _getNormalText(widget.covidPaymentInfoResponse.patientTaxAmountField.toString(), isBold: true),
TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)), )
TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientTaxAmountField.toString())),
]),
TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientShareWithTaxField.toString())),
]),
], ],
), ),
),
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(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 5.0), margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -169,71 +228,121 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
}, },
activeColor: Color(0xffB8382C), activeColor: Color(0xffB8382C),
), ),
Texts(TranslationBase.of(context).iAgreeToTheTermsAndConditions), 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,
),
),
], ],
), ),
), ),
Divider( mFlex(1),
color: Colors.grey,
Text(
TranslationBase.of(context).payOptions,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
), ),
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( Container(
alignment: Alignment.center, margin: EdgeInsets.only(top: 12, bottom: 12),
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), child: Image.asset("assets/images/new-design/payment_options_invoice_confirmation.png", width: 300),
), ),
], ],
), ),
), ),
), ),
bottomSheet: Container( Container(
color: Colors.grey[100], width: double.infinity,
padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0), child: Card(
child: Flex( elevation: 20,
direction: Axis.horizontal, margin: EdgeInsets.zero,
children: <Widget>[ child: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 12, left: 12, right: 12),
child: Row(
children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: DefaultButton(TranslationBase.of(context).cancel, () { child: RaisedButton(
color: CustomColors.darkGreyColor,
textColor: Colors.white,
elevation: 0,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
cancel(); cancel();
}, color: Color(0xffEAEAEA), textColor: Color(0xff000000)), },
child: Text(
TranslationBase.of(context).cancel,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.48,
color: Colors.black,
fontWeight: FontWeight.w600,
),
),
), ),
), ),
), ),
),
mWidth(12),
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: DefaultButton( 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, TranslationBase.of(context).next,
isAgree style: TextStyle(
? () { fontSize: 16.0,
next(); letterSpacing: -0.48,
} fontWeight: FontWeight.w600,
: null, ),
disabledColor: Color(0x8ac5272d), ),
),
), ),
), ),
), ),
],
),
),
), ),
)
], ],
), ),
), ),
@ -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,60 +1,67 @@
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),
),
], ],
), ),
); );
@ -63,9 +70,11 @@ class RRTLogListItem extends StatelessWidget{
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';
@ -40,11 +40,7 @@ class RRTPlaceOrderPage extends StatelessWidget {
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
body: Column( body: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: SingleChildScrollView(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
@ -69,19 +65,17 @@ class RRTPlaceOrderPage extends StatelessWidget {
height: 10, height: 10,
), ),
Container( Container(
height: 80, height: 85,
margin: EdgeInsets.symmetric(vertical: 5), margin: EdgeInsets.symmetric(vertical: 5),
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10), padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white, borderRadius: BorderRadius.circular(10), boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2, 2), color: Colors.grey.withOpacity(0.25))]),
borderRadius: BorderRadius.circular(10),
boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2, 2), color: Colors.grey.withOpacity(0.25))]),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
localize.totalAmountPayable, localize.patientShareWithTax,
style: TextStyle(fontSize: 13), style: TextStyle(fontSize: 13),
), ),
SizedBox( SizedBox(
@ -99,9 +93,7 @@ class RRTPlaceOrderPage extends StatelessWidget {
margin: EdgeInsets.symmetric(vertical: 5), margin: EdgeInsets.symmetric(vertical: 5),
padding: EdgeInsets.symmetric(horizontal: 0, vertical: 10), padding: EdgeInsets.symmetric(horizontal: 0, vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white, borderRadius: BorderRadius.circular(10), boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2, 2), color: Colors.grey.withOpacity(0.25))]),
borderRadius: BorderRadius.circular(10),
boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2, 2), color: Colors.grey.withOpacity(0.25))]),
child: TextField( child: TextField(
controller: noteController, controller: noteController,
style: TextStyle(fontSize: 18.0), style: TextStyle(fontSize: 18.0),
@ -123,10 +115,8 @@ class RRTPlaceOrderPage extends StatelessWidget {
], ],
), ),
), ),
), bottomSheet: submitButton(context),
submitButton(context) );
],
));
}, },
); );
} }
@ -135,7 +125,6 @@ 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,
@ -152,17 +141,19 @@ class RRTPlaceOrderPage extends StatelessWidget {
], ],
), ),
), ),
),
); );
} }
Widget submitButton(BuildContext context) { Widget submitButton(BuildContext context) {
return Padding( return Container(
color: Theme.of(context).scaffoldBackgroundColor,
child: Padding(
padding: const EdgeInsets.all(15), padding: const EdgeInsets.all(15),
child: DefaultButton( child: DefaultButton(
localize.submit, localize.submit,
() => placeOrder(), () => 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,
okFunction: () {
AlertDialogBox.closeAlertDialog(_context);
gotoRRTRoot(); gotoRRTRoot();
}).showAlertDialog(_context); // Navigator.pop(_context);
// Navigator.pop(_context);
},
);
} }
// if (requestId != null) {
// AlertDialogBox(
// context: _context,
// title: '',
// confirmMessage: localize.rrtOrderSuccessMessage,
// okText: localize.ok,
// okFunction: () {
// AlertDialogBox.closeAlertDialog(_context);
// gotoRRTRoot();
// }).showAlertDialog(_context);
// }
} else { } 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,15 +38,10 @@ 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(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
updateSelectedPaymentMethod("MADA"); updateSelectedPaymentMethod("MADA");
@ -54,18 +54,30 @@ class _PaymentMethodState extends State<PaymentMethod> {
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Row(
height: 120.0, children: [
Container(
height: 60.0,
width: 60,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset("assets/images/new-design/mada.png"), child: Image.asset("assets/images/new-design/mada.png"),
), ),
mWidth(12),
Text(
"Mada",
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold,
), ),
)
],
), ),
), ),
), ),
Expanded( ),
child: Container( Container(
width: double.infinity,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
updateSelectedPaymentMethod("VISA"); updateSelectedPaymentMethod("VISA");
@ -78,26 +90,30 @@ class _PaymentMethodState extends State<PaymentMethod> {
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Row(
height: 120.0, children: [
Container(
height: 60.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: 60,
child: Image.asset("assets/images/new-design/visa.png"), child: Image.asset("assets/images/new-design/visa.png"),
), ),
mWidth(12),
Text(
"VISA",
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold,
), ),
)
],
), ),
), ),
), ),
],
),
), ),
Container( Container(
margin: EdgeInsets.only(top: 25.0), width: double.infinity,
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
updateSelectedPaymentMethod("MASTERCARD"); updateSelectedPaymentMethod("MASTERCARD");
@ -110,18 +126,30 @@ class _PaymentMethodState extends State<PaymentMethod> {
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Row(
height: 120.0, children: [
Container(
height: 60.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: 60,
child: Image.asset("assets/images/new-design/mastercard.png"), child: Image.asset("assets/images/new-design/mastercard.png"),
), ),
mWidth(12),
Text(
"MasterCard",
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold,
), ),
)
],
), ),
), ),
), ),
Expanded( ),
child: Container( Container(
width: double.infinity,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
updateSelectedPaymentMethod("Installment"); updateSelectedPaymentMethod("Installment");
@ -134,26 +162,31 @@ class _PaymentMethodState extends State<PaymentMethod> {
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Row(
height: 120.0, children: [
Container(
height: 60.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: 60,
child: Image.asset("assets/images/new-design/installment.png"), 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,
children: <Widget>[
Expanded(
child: Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
updateSelectedPaymentMethod("ApplePay"); updateSelectedPaymentMethod("ApplePay");
@ -166,21 +199,63 @@ class _PaymentMethodState extends State<PaymentMethod> {
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Row(
height: 120.0, children: [
padding: EdgeInsets.all(20.0), Container(
height: 60.0,
padding: EdgeInsets.all(7.0),
width: 60,
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( )
child: Container(), // Container(
), // margin: EdgeInsets.only(top: 25.0),
], // child: Flex(
), // direction: Axis.horizontal,
) : Container(), // children: <Widget>[
// Expanded(
// child: Container(
// child: InkWell(
// onTap: () {
// updateSelectedPaymentMethod("ApplePay");
// },
// child: Card(
// elevation: 3.0,
// margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
// ),
// child: Container(
// height: 120.0,
// padding: EdgeInsets.all(20.0),
// child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
// ),
// ),
// ),
// ),
// ),
// Expanded(
// child: Container(),
// ),
// ],
// ),
// )
: Container(),
SizedBox( 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,37 +29,113 @@ 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: Column(
children: [
Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.all(45.0), width: double.infinity,
child: Text(TranslationBase.of(context).enterPassportNumber, textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, color: Colors.black)), child: Card(
shape: cardRadius(12),
margin: EdgeInsets.zero,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).covidBookAppo,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
letterSpacing: -0.64,
),
),
mHeight(6),
Row(
children: [
Text(
TranslationBase.of(context).patientName + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).fileNo + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
],
),
),
),
),
mHeight(40),
SvgPicture.asset("assets/images/new/passport.svg", width: 40.0, fit: BoxFit.fill),
mHeight(12),
Text(
TranslationBase.of(context).enterPassportNumber,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
color: Colors.black,
letterSpacing: -0.64,
),
),
mHeight(8),
inputWidget(TranslationBase.of(context).passportNumber, "", passportNumber),
],
),
),
), ),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: SvgPicture.asset("assets/images/new-design/passport.svg", width: 250.0, fit: BoxFit.fill),
), ),
Container( Container(
margin: EdgeInsets.only(left: 50.0, right: 50.0, top: 25.0), margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0, bottom: 10.0),
child: TextFields(
keyboardType: TextInputType.text,
fontWeight: FontWeight.normal,
controller: passportNumber,
onChanged: (value) => {_onPassportTextChanged(value)},
padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).passportNumber,
)),
Container(
margin: EdgeInsets.only(top: 30.0, left: 45.0, right: 45.0, bottom: 10.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
@ -65,6 +146,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
color: new Color(0xFFc5272d), color: new Color(0xFFc5272d),
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
elevation: 0,
disabledColor: Colors.red[300], disabledColor: Colors.red[300],
onPressed: () { onPressed: () {
if (_isButtonDisabled == false) if (_isButtonDisabled == false)
@ -72,13 +154,100 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
else else
AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber); AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber);
}, },
child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)), child: Text(
TranslationBase.of(context).submit,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.64,
),
),
),
),
),
],
),
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (value) => {_onPassportTextChanged(value)},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
), ),
), ),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
), ),
], ],
), ),
), ),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
), ),
); );
} }
@ -116,7 +285,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
GifLoaderDialogUtils.hideDialog(context); 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,31 +38,14 @@ 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;
@ -90,33 +57,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;
} }
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;
@ -128,32 +80,17 @@ 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;

@ -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,7 +631,8 @@ 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)
Divider(
height: 1, height: 1,
color: Color(0xff2E303A), color: Color(0xff2E303A),
thickness: 1, 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