Merge branch 'development_new_design_2.0' into zik_new_design_2.0

* development_new_design_2.0:
  Translation update
  Fixes & updates
  Blood donation fixes
  Pharmacy Payment method design fix, Blood Donation fix
  improvements
  blood donation dialog change & improvements.
  Pharmacy updates
  Pharmacy prescriptions page design
  LiveCare design fixes
merge-requests/461/head
Zohaib Iqbal Kambrani 5 years ago
commit 4c5b9b4244

@ -421,7 +421,7 @@ const Map localizedValues = {
"country": {"en": "Country", "ar": "دولة"}, "country": {"en": "Country", "ar": "دولة"},
"Ok": {"en": "Ok", "ar": "موافق"}, "Ok": {"en": "Ok", "ar": "موافق"},
"averageWaitingTime": {"en": "Average Waiting Time:", "ar": "متوسط ​​وقت الانتظار:"}, "averageWaitingTime": {"en": "Average Waiting Time:", "ar": "متوسط ​​وقت الانتظار:"},
"waitingTime": {"en": "Waiting Time:", "ar": "وقت الانتظار:"}, "waitingTime": {"en": "Expected waiting time:", "ar": "وقت الانتظار المتوقع:"},
"WaterConsumedInWeek": {"en": "Water consumed in a week", "ar": "معدل شرب الماء خلال الاسبوع"}, "WaterConsumedInWeek": {"en": "Water consumed in a week", "ar": "معدل شرب الماء خلال الاسبوع"},
"WaterConsumedInMonth": {"en": "Water consumed in a month", "ar": "معدل شرب الماء خلال الشهر"}, "WaterConsumedInMonth": {"en": "Water consumed in a month", "ar": "معدل شرب الماء خلال الشهر"},
"TheVerificationCodeExpiresIn": {"en": "The Verification Code Expires in", "ar": "تنتهي صلاحية رمز التحقق في"}, "TheVerificationCodeExpiresIn": {"en": "The Verification Code Expires in", "ar": "تنتهي صلاحية رمز التحقق في"},
@ -1290,7 +1290,7 @@ const Map localizedValues = {
"pay-options": {"en": "You can pay by the following Options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"}, "pay-options": {"en": "You can pay by the following Options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"},
"livecare-service": {"en": "LiveCare Service", "ar": "خدمة لايف كير"}, "livecare-service": {"en": "LiveCare Service", "ar": "خدمة لايف كير"},
"livecare-service-desc": {"en": "is to obtain medical advice with a specialist doctor Via a video call", "ar": "هي الحصول على استشارة طبية مع طبيب مختص عن طريق اتصال فيديو"}, "livecare-service-desc": {"en": "is to obtain medical advice with a specialist doctor Via a video call", "ar": "هي الحصول على استشارة طبية مع طبيب مختص عن طريق اتصال فيديو"},
"why-livecare": {"en": "WHY LIVECARE", "ar": "لماذا خدمة اللايف كير"}, "why-livecare": {"en": "Why LiveCare?", "ar": "?لماذا خدمة اللايف كير"},
"livecare-point-1": {"en": "No need to wait you will get Medical consultation immediately via Video call", "ar": "لا داعي للانتظار سوف تحصل على الاستشارة الطبية فورا عن طريق مكالمة الفيديو"}, "livecare-point-1": {"en": "No need to wait you will get Medical consultation immediately via Video call", "ar": "لا داعي للانتظار سوف تحصل على الاستشارة الطبية فورا عن طريق مكالمة الفيديو"},
"doc-virtual-appo-ins4": {"en": "The doctor will see your medical file", "ar": "سوف يتمكن الطبيب من الاطلاع على ملفك الطبي كامل"}, "doc-virtual-appo-ins4": {"en": "The doctor will see your medical file", "ar": "سوف يتمكن الطبيب من الاطلاع على ملفك الطبي كامل"},
"doc-virtual-appo-ins5": {"en": "Free prescription delivery service", "ar": "خدمة توصيل الادوية مجانا"}, "doc-virtual-appo-ins5": {"en": "Free prescription delivery service", "ar": "خدمة توصيل الادوية مجانا"},
@ -1298,7 +1298,7 @@ const Map localizedValues = {
"en": "** The service is included with some insurance companies according to the terms and conditions with our best wishes for health and wellness", "en": "** The service is included with some insurance companies according to the terms and conditions with our best wishes for health and wellness",
"ar": "** الخدمة مشمولة لدى بعض شركات التامين على حسب الشروط والاحكام مع تمنياتنا لكم بدوام الصحة والعافية" "ar": "** الخدمة مشمولة لدى بعض شركات التامين على حسب الشروط والاحكام مع تمنياتنا لكم بدوام الصحة والعافية"
}, },
"livecare-option-1": {"en": "Get Medical consultation immediately", "ar": "الحصول على الاستشارة فورا"}, "livecare-option-1": {"en": "Get consultation immediately", "ar": "الحصول على الاستشارة فورا"},
"livecare-option-2": {"en": "Instant video call", "ar": "اتصال فيديو فوري"}, "livecare-option-2": {"en": "Instant video call", "ar": "اتصال فيديو فوري"},
"livecare-option-3": {"en": "Book Appointment", "ar": "حجز موعد"}, "livecare-option-3": {"en": "Book Appointment", "ar": "حجز موعد"},
"livecare-option-4": {"en": "Schedule video call", "ar": "اتصال فيديو مجدول"}, "livecare-option-4": {"en": "Schedule video call", "ar": "اتصال فيديو مجدول"},

@ -22,7 +22,7 @@ class BloodDetailsService extends BaseService{
BloodModelList.add(List_BloodGroupDetailsModel.fromJson(vital)); BloodModelList.add(List_BloodGroupDetailsModel.fromJson(vital));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; // hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} }

@ -32,7 +32,7 @@ class MyBalanceViewModel extends BaseViewModel {
_bloodDonationService.CitiesModelList; _bloodDonationService.CitiesModelList;
BloodDetailsService _bloodDetailsService = locator<BloodDetailsService>(); BloodDetailsService _bloodDetailsService = locator<BloodDetailsService>();
List<List_BloodGroupDetailsModel> get BloodDetailsModelList => List<List_BloodGroupDetailsModel> get bloodDetailsModelList =>
_bloodDetailsService _bloodDetailsService
.BloodModelList; //_bloodDonationService.CitiesModelList; .BloodModelList; //_bloodDonationService.CitiesModelList;
@ -52,6 +52,9 @@ class MyBalanceViewModel extends BaseViewModel {
PatientInfoAndMobileNumber get patientInfoAndMobileNumber => PatientInfoAndMobileNumber get patientInfoAndMobileNumber =>
_myBalanceService.patientInfoAndMobileNumber; _myBalanceService.patientInfoAndMobileNumber;
List<List_BloodGroupDetailsModel> get bloodModelList =>
_bloodDetailsService.BloodModelList;
String get logInTokenID => _myBalanceService.logInTokenID; String get logInTokenID => _myBalanceService.logInTokenID;
String get verificationCode => _myBalanceService.verificationCode; String get verificationCode => _myBalanceService.verificationCode;

@ -228,4 +228,4 @@ class OrderPreviewViewModel extends BaseViewModel {
} }
} }
enum PaymentOption { meda, sadad, visa, mastercard, installments } enum PaymentOption { meda, sadad, visa, mastercard, installments, applepay }

@ -14,7 +14,7 @@ class PrescriptionViewModel extends BaseViewModel {
getPrescription() async { getPrescription() async {
await getSavedLanguage(); await getSavedLanguage();
if(prescriptionsList.isNotEmpty){ if(prescriptionsList.isEmpty){
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getPrescription(); await _prescriptionService.getPrescription();
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {

@ -51,36 +51,6 @@ class OrdersLogDetailsPage extends StatelessWidget {
}, },
)); ));
return; return;
// todo 'sikander' remove useless code
showDialog(
context: context,
child: ConfirmCancelOrderDialog(
model: model,
onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.updateCmcPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
GifLoaderDialogUtils.hideDialog(context);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getCmcAllPresOrders();
GifLoaderDialogUtils.hideDialog(context);
}
});
// await model.updateCmcPresOrder(updatePresOrderRequestModel);
// if (model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast(model.error);
// } else {
// AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
// await model.getCmcAllPresOrders();
// }
},
),
);
} }
return AppScaffold( return AppScaffold(

@ -95,7 +95,7 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
), ),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.all(16), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).next, TranslationBase.of(context).next,
(this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal) (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal)

@ -87,236 +87,219 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold( return PageView(
body: SafeArea( physics: NeverScrollableScrollPhysics(),
child: SingleChildScrollView( controller: _controller,
child: Container( onPageChanged: (index) {
height: MediaQuery.of(context).size.height * 0.8, setState(() {
child: Column( _currentIndex = index;
children: [ });
Expanded( },
child: PageView( scrollDirection: Axis.horizontal,
physics: NeverScrollableScrollPhysics(), children: <Widget>[
controller: _controller, widget.model.pendingOrder != null
onPageChanged: (index) { ? ListView(padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), children: [
setState(() { (Container(
_currentIndex = index; decoration: BoxDecoration(
}); color: Color(0xffCC9B14),
}, borderRadius: BorderRadius.all(
scrollDirection: Axis.horizontal, Radius.circular(10.0),
children: <Widget>[ ),
widget.model.pendingOrder != null boxShadow: [
? ListView(padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), children: [ BoxShadow(
(Container( color: Color(0xff000000).withOpacity(.05),
decoration: BoxDecoration( blurRadius: 27,
color: Color(0xffCC9B14), offset: Offset(0, -3),
borderRadius: BorderRadius.all( ),
Radius.circular(10.0), ],
),
child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
),
),
// clipBehavior: Clip.antiAlias,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.model.pendingOrder.statusText,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffCC9B14), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder.iD.toString()}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).serviceName + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
boxShadow: [ Column(
BoxShadow( children: [
color: Color(0xff000000).withOpacity(.05), ...List.generate(
blurRadius: 27, widget.model.hhcAllOrderDetail.length,
offset: Offset(0, -3), (index) => Container(
), child: Texts(
], projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(),
), fontSize: 13,
bold: false,
),
),
)
],
)
],
)
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.created)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 12),
if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2)
InkWell(
onTap: () {
showConfirmMessage(widget.model, widget.model.pendingOrder);
},
child: Container( child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1), border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.circular(10),
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
),
), ),
// clipBehavior: Clip.antiAlias, child: Text(
child: Row( TranslationBase.of(context).cancel_nocaps,
crossAxisAlignment: CrossAxisAlignment.start, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.model.pendingOrder.statusText,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffCC9B14), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder.iD.toString()}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).serviceName + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Column(
children: [
...List.generate(
widget.model.hhcAllOrderDetail.length,
(index) => Container(
child: Texts(
projectViewModel.isArabic
? widget.model.hhcAllOrderDetail[index].descriptionN
: widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontSize: 13,
bold: false,
),
),
)
],
)
],
)
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.created)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 12),
if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2)
InkWell(
onTap: () {
showConfirmMessage(widget.model, widget.model.pendingOrder);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
],
),
],
), ),
), ),
)) ),
]) ],
),
// FractionallySizedBox( ],
// widthFactor: 0.9, ),
// child: SingleChildScrollView(
// child: Container(
// // margin: EdgeInsets.all(10),
// child: Container(
// width: double.infinity,
// padding: EdgeInsets.only(left: 12, right: 12, top: 12),
// child: Card(
// shape: cardRadius(12),
// elevation: 2,
// margin: EdgeInsets.zero,
// color: Color(0xffcd9e1b),
// clipBehavior: Clip.antiAlias,
// child: Container(
// // decoration: containerColorRadiusLeft(Colors.white, 12),
// margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0),
// padding: EdgeInsets.all(12),
// // color: Colors.white,
// decoration: BoxDecoration(
// shape: BoxShape.rectangle,
// color: Colors.white,
// borderRadius: BorderRadius.only(
// topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
// topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
// bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
// bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
// ),
// ),
// // clipBehavior: Clip.antiAlias,
// child: Row(
// children: [
// Expanded(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).OrderStatus +
// ' ' +
// (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
// bold: false,
// fontSize: 12,
// color: Color(0xffcd9e1b),
// fontWeight: FontWeight.bold,
// ),
// Texts(
// TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(),
// fontWeight: FontWeight.w600,
// fontSize: 18,
// ),
// Texts(
// TranslationBase.of(context).serviceName,
// fontSize: 12,
// fontWeight: FontWeight.w600,
// ),
// ...List.generate(
// widget.model.hhcAllOrderDetail.length,
// (index) => Container(
// child: Texts(
// projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(),
// fontSize: 13,
// bold: false,
// ),
// ),
// ),
// ],
// )),
// Column(
// children: [
// Texts(
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
// fontSize: 14,
// ),
// mHeight(8),
// // SecondaryButton(
// // onTap: () {
// // showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
// // },
// // label: TranslationBase.of(context).cancel,
// // color: Colors.red[900],
// // small: true,
// // )
// ],
// ),
// ],
// ))),
// ))))
: NewHomeHealthCareStepOnePage(
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
model: widget.model,
),
],
), ),
), ))
], ])
),
), // FractionallySizedBox(
), // widthFactor: 0.9,
), // child: SingleChildScrollView(
// child: Container(
// // margin: EdgeInsets.all(10),
// child: Container(
// width: double.infinity,
// padding: EdgeInsets.only(left: 12, right: 12, top: 12),
// child: Card(
// shape: cardRadius(12),
// elevation: 2,
// margin: EdgeInsets.zero,
// color: Color(0xffcd9e1b),
// clipBehavior: Clip.antiAlias,
// child: Container(
// // decoration: containerColorRadiusLeft(Colors.white, 12),
// margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0),
// padding: EdgeInsets.all(12),
// // color: Colors.white,
// decoration: BoxDecoration(
// shape: BoxShape.rectangle,
// color: Colors.white,
// borderRadius: BorderRadius.only(
// topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
// topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
// bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
// bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
// ),
// ),
// // clipBehavior: Clip.antiAlias,
// child: Row(
// children: [
// Expanded(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).OrderStatus +
// ' ' +
// (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
// bold: false,
// fontSize: 12,
// color: Color(0xffcd9e1b),
// fontWeight: FontWeight.bold,
// ),
// Texts(
// TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(),
// fontWeight: FontWeight.w600,
// fontSize: 18,
// ),
// Texts(
// TranslationBase.of(context).serviceName,
// fontSize: 12,
// fontWeight: FontWeight.w600,
// ),
// ...List.generate(
// widget.model.hhcAllOrderDetail.length,
// (index) => Container(
// child: Texts(
// projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(),
// fontSize: 13,
// bold: false,
// ),
// ),
// ),
// ],
// )),
// Column(
// children: [
// Texts(
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
// fontSize: 14,
// ),
// mHeight(8),
// // SecondaryButton(
// // onTap: () {
// // showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
// // },
// // label: TranslationBase.of(context).cancel,
// // color: Colors.red[900],
// // small: true,
// // )
// ],
// ),
// ],
// ))),
// ))))
: NewHomeHealthCareStepOnePage(
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
model: widget.model,
),
],
); );
} }
} }

@ -45,27 +45,6 @@ class OrdersLogDetailsPage extends StatelessWidget {
), ),
); );
return; return;
// todo 'sikander' remove useless code
showDialog(
context: context,
child: ConfirmCancelOrderDialog(
model: model,
onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
model.setState(ViewState.Busy);
await model.updateHHCPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getHHCAllPresOrders();
// await model.getHHCAllServices();
}
},
),
);
} }
return AppScaffold( return AppScaffold(

@ -1,104 +0,0 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// todo 'sikander' remove useless code
// ignore: must_be_immutable
// class ConfirmAddAmountDialog extends StatefulWidget {
// final int amount;
// final String unit;
// final H2OViewModel model;
//
// ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"});
//
// @override
// _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState();
// }
//
// class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
// @override
// void initState() {
// super.initState();
// }
//
// @override
// Widget build(BuildContext context) {
// return SimpleDialog(
// contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0),
// titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0),
// title: Center(
// child: Texts(
// TranslationBase.of(context).confirm,
// textAlign: TextAlign.center,
// color: Colors.black,
// ),
// ),
// children: [
// Column(
// children: [
// Divider(),
// Center(
// child: Texts(
// "${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?",
// textAlign: TextAlign.center,
// color: Colors.grey,
// ),
// ),
// SizedBox(
// height: 16.0,
// ),
// Row(
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () {
// Navigator.pop(context);
// },
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// child: Center(
// child: Texts(
// TranslationBase.of(context).cancel.toUpperCase(),
// color: Colors.red,
// ),
// ),
// ),
// ),
// ),
// ),
// Container(
// width: 1,
// height: 30,
// color: Colors.grey[500],
// ),
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () async {
// InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount);
// await widget.model.insertUserActivity(insertUserActivityRequestModel);
// Navigator.pop(context);
// },
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Center(
// child: Texts(
// TranslationBase.of(context).ok.toUpperCase(),
// fontWeight: FontWeight.w400,
// )),
// ),
// ),
// ),
// ],
// ),
// ],
// )
// ],
// );
// }
// }

@ -1,166 +0,0 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// todo 'sikander' remove useless code
// ignore: must_be_immutable
// class SelectAmountDialog extends StatefulWidget {
// final Function(AmountModel) onValueSelected;
// AmountModel selectedAmount;
//
// SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount});
//
// @override
// _SelectAmountDialogState createState() => _SelectAmountDialogState();
// }
//
// class _SelectAmountDialogState extends State<SelectAmountDialog> {
// List<AmountModel> searchAmount = [
// AmountModel(name: "l", nameAr: "لتر", value: 1),
// AmountModel(name: "ml", nameAr: "مم لتر", value: 2),
// ];
// @override
// void initState() {
// super.initState();
// widget.selectedAmount = widget.selectedAmount ?? searchAmount[0];
// getLanguage();
// }
//
// String languageID = "en";
//
// void getLanguage() async {
// languageID = await sharedPref.getString(APP_LANGUAGE);
// setState(() {});
// }
//
// @override
// Widget build(BuildContext context) {
// return SimpleDialog(
// children: [
// Column(
// children: [
// Texts(
// TranslationBase.of(context).preferredunit,
// fontSize: 20,
// ),
// Divider(),
// ...List.generate(
// searchAmount.length,
// (index) => Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// SizedBox(
// height: 2,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () {
// setState(() {
// widget.selectedAmount = searchAmount[index];
// });
// },
// child: ListTile(
// title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name),
// leading: Radio(
// value: searchAmount[index],
// groupValue: widget.selectedAmount,
// activeColor: Colors.red[800],
// onChanged: (value) {
// setState(() {
// widget.selectedAmount = value;
// });
// },
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// ],
// ),
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () {
// Navigator.pop(context);
// },
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// child: Center(
// child: Texts(
// TranslationBase.of(context).cancel.toUpperCase(),
// color: Colors.red,
// ),
// ),
// ),
// ),
// ),
// ),
// Container(
// width: 1,
// height: 30,
// color: Colors.grey[500],
// ),
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () {
// widget.onValueSelected(widget.selectedAmount);
// Navigator.pop(context);
// },
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Center(
// child: Texts(
// TranslationBase.of(context).ok,
// fontWeight: FontWeight.w400,
// )),
// ),
// ),
// ),
// ],
// )
// ],
// )
// ],
// );
// }
// }
//
// class AmountModel {
// String name;
// String nameAr;
// int value;
//
// AmountModel({this.name, this.nameAr, this.value});
//
// AmountModel.fromJson(Map<String, dynamic> json) {
// name = json['name'];
// nameAr = json['nameAr'];
// value = json['value'];
// }
//
// Map<String, dynamic> toJson() {
// final Map<String, dynamic> data = new Map<String, dynamic>();
// data['name'] = this.name;
// data['nameAr'] = this.nameAr;
// data['value'] = this.value;
// return data;
// }
// }

@ -1,133 +0,0 @@
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'Dialog/select_amount_dialog.dart';
// todo 'sikander' remove useless code
// class AddCustomAmount extends StatefulWidget {
// final H2OViewModel model;
// final Function changePageViewIndex;
//
// const AddCustomAmount({Key key, this.model, this.changePageViewIndex})
// : super(key: key);
//
// @override
// _AddCustomAmountState createState() => _AddCustomAmountState();
// }
//
// class _AddCustomAmountState extends State<AddCustomAmount> {
// TextEditingController _nameTextController = TextEditingController();
// AmountModel selectedAmount;
//
// @override
// void initState() {
// setState(() {
// _nameTextController.text = "0";
// });
// super.initState();
// }
//
// @override
// Widget build(BuildContext context) {
// return AppScaffold(
// isShowAppBar: true,
// appBarTitle:TranslationBase.of(context).customLabel,
// body: SingleChildScrollView(
// physics: ScrollPhysics(),
// child: Container(
// margin: EdgeInsets.all(12),
// child: Center(
// child: FractionallySizedBox(
// widthFactor: 0.94,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// SizedBox(
// height: 12,
// ),
// NewTextFields(
// hintText: TranslationBase.of(context).h2oAmountOfWater,
// // type: "Number",
// controller: _nameTextController,
// ),
// SizedBox(
// height: 12,
// ),
// InkWell(
// onTap: () => confirmAmountTypeDialog(),
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Texts(getAmountName()),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// SecondaryButton(
// textColor: Colors.white,
// label: TranslationBase.of(context).ok,
// onTap: () async {
// Navigator.of(context).pop();
// showConfirmMessage (int.parse(_nameTextController.text), widget.model);
// },
// // loading: model.state == ViewState.BusyLocal,
// disabled: _nameTextController.text.isEmpty || selectedAmount == null),
// SizedBox(
// height: 12,
// ),
// ],
// ),
// ),
// ),
// ),
// ),
// );
// }
//
//
// void confirmAmountTypeDialog() {
// showDialog(
// context: context,
// child: SelectAmountDialog(
// selectedAmount: selectedAmount,
// onValueSelected: (value) {
// setState(() {
// selectedAmount = value;
// });
// },
// ),
// );
// }
//
//
// String getAmountName() {
// if (selectedAmount != null)
// return selectedAmount.name;
// else
// return TranslationBase.of(context).selectUnit;
// }
//
//
//
// void showConfirmMessage(int amount, H2OViewModel model) {
// showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,));
// }
// }

@ -126,7 +126,7 @@ class _H2oSettingState extends State<H2oSetting> {
), ),
), ),
SizedBox(height: 12), SizedBox(height: 12),
_containerWidget(inputWidget(TranslationBase.of(context).enterNameHere, TranslationBase.of(context).name, _nameController)), inputWidget(TranslationBase.of(context).enterNameHere, TranslationBase.of(context).name, _nameController).withBorderedContainer,
SizedBox(height: 16), SizedBox(height: 16),
Text( Text(
TranslationBase.of(context).preferredunit, TranslationBase.of(context).preferredunit,
@ -210,80 +210,77 @@ class _H2oSettingState extends State<H2oSetting> {
}, },
_weightPopupList), _weightPopupList),
SizedBox(height: 12), SizedBox(height: 12),
_containerWidget( CommonDropDownView(TranslationBase.of(context).dateOfBirth, DateUtil.getFormattedDate(_dobDate, "dd MMMM, yyyy"), () {
_commonDropDownView(TranslationBase.of(context).dateOfBirth, DateUtil.getFormattedDate(_dobDate, "dd MMMM, yyyy"), () { showModalBottomSheet(
showModalBottomSheet( context: context,
context: context, builder: (context) {
builder: (context) { return Container(
return Container( height: 250,
height: 250, padding: EdgeInsets.all(8),
padding: EdgeInsets.all(8), child: Column(children: [
child: Column(children: [ Container(
Container( height: 40,
height: 40, alignment: Alignment.centerRight,
alignment: Alignment.centerRight, child: Row(mainAxisSize: MainAxisSize.min, children: [
child: Row(mainAxisSize: MainAxisSize.min, children: [ InkWell(
InkWell( onTap: () => Navigator.pop(context),
onTap: () => Navigator.pop(context), child: Container(
child: Container( alignment: Alignment.center,
alignment: Alignment.center, padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
padding: EdgeInsets.fromLTRB(8, 4, 8, 4), child: Text(TranslationBase.of(context).cancel),
child: Text(TranslationBase.of(context).cancel),
),
), ),
SizedBox(width: 8), ),
InkWell( SizedBox(width: 8),
onTap: () { InkWell(
Navigator.pop(context); onTap: () {
setState(() { Navigator.pop(context);
_dobDate = _tempDate; setState(() {
}); _dobDate = _tempDate;
}, });
child: Container( },
alignment: Alignment.center, child: Container(
padding: EdgeInsets.fromLTRB(8, 4, 8, 4), alignment: Alignment.center,
child: Text(TranslationBase.of(context).ok), padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
), child: Text(TranslationBase.of(context).ok),
)
]),
),
Expanded(
child: Container(
width: MediaQuery.of(context).size.width,
child: CupertinoDatePicker(
initialDateTime: _dobDate,
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (_date) {
_tempDate = _date;
},
), ),
)
]),
),
Expanded(
child: Container(
width: MediaQuery.of(context).size.width,
child: CupertinoDatePicker(
initialDateTime: _dobDate,
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (_date) {
_tempDate = _date;
},
), ),
) ),
]), )
); ]),
}); );
}, iconData: Icons.calendar_today), });
), }, iconData: Icons.calendar_today)
.withBorderedContainer,
SizedBox(height: 12), SizedBox(height: 12),
_containerWidget( CommonDropDownView(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () {
_commonDropDownView(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () { List<RadioSelectionDialogModel> list = [
List<RadioSelectionDialogModel> list = [ for (int i = 0; i < _activityLevelListEng.length; i++) RadioSelectionDialogModel(_activityLevelListEng[i], i + 1),
for (int i = 0; i < _activityLevelListEng.length; i++) RadioSelectionDialogModel(_activityLevelListEng[i], i + 1), ];
];
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( child: RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedActiveLevel, selectedIndex: _selectedActiveLevel,
onValueSelected: (index) { onValueSelected: (index) {
_selectedActiveLevel = index; _selectedActiveLevel = index;
setState(() {}); setState(() {});
}, },
), ),
); );
}), }).withBorderedContainer,
),
SizedBox(height: 18), SizedBox(height: 18),
Text( Text(
TranslationBase.of(context).reminderLabel, TranslationBase.of(context).reminderLabel,
@ -296,25 +293,23 @@ class _H2oSettingState extends State<H2oSetting> {
), ),
), ),
SizedBox(height: 12), SizedBox(height: 12),
_containerWidget( CommonDropDownView(TranslationBase.of(context).reminderTimesLabel, _remindedTimeListEng[_selectedRemindedTime], () {
_commonDropDownView(TranslationBase.of(context).reminderTimesLabel, _remindedTimeListEng[_selectedRemindedTime], () { List<RadioSelectionDialogModel> list = [
List<RadioSelectionDialogModel> list = [ for (int i = 0; i < _remindedTimeListEng.length; i++) RadioSelectionDialogModel(_remindedTimeListEng[i], i),
for (int i = 0; i < _remindedTimeListEng.length; i++) RadioSelectionDialogModel(_remindedTimeListEng[i], i), ];
];
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( child: RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedRemindedTime, selectedIndex: _selectedRemindedTime,
onValueSelected: (index) { onValueSelected: (index) {
_selectedRemindedTime = index; _selectedRemindedTime = index;
setState(() {}); setState(() {});
}, },
), ),
); );
}), }).withBorderedContainer,
),
], ],
), ),
), ),
@ -333,58 +328,6 @@ class _H2oSettingState extends State<H2oSetting> {
); );
} }
Widget _containerWidget(Widget child) {
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: child,
);
}
Widget _commonDropDownView(String title, String value, VoidCallback callback, {IconData iconData}) {
return InkWell(
onTap: callback,
child: Row(
children: [
Expanded(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(
title,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.44,
),
),
Text(
value,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
),
]),
),
Icon(
iconData ?? Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
],
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return InkWell( return InkWell(
onTap: hasSelection ? () {} : null, onTap: hasSelection ? () {} : null,
@ -501,81 +444,79 @@ class _H2oSettingState extends State<H2oSetting> {
Widget _commonInputAndUnitRow(_title, _controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange, String unitTitle, Widget _commonInputAndUnitRow(_title, _controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange, String unitTitle,
Function(bool) onUnitTap, _list) { Function(bool) onUnitTap, _list) {
return _containerWidget( return Row(
Row( children: [
children: [ Expanded(
Expanded( flex: 3,
flex: 3, child: Column(
child: Column( mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Text(
Text( _title,
_title, style: TextStyle(
style: TextStyle( fontSize: 12,
fontSize: 12, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, color: Color(0xff2E303A),
color: Color(0xff2E303A), letterSpacing: -0.44,
letterSpacing: -0.44,
),
), ),
TextField( ),
controller: _controller, TextField(
keyboardType: TextInputType.number, controller: _controller,
onChanged: (value) { keyboardType: TextInputType.number,
double _value = double.parse(value); onChanged: (value) {
if (_value > _maxValue) { double _value = double.parse(value);
onTextValueChange(_maxValue.toStringAsFixed(0)); if (_value > _maxValue) {
onValueChange(_maxValue); onTextValueChange(_maxValue.toStringAsFixed(0));
return; onValueChange(_maxValue);
} else if (_value < _minValue) { return;
onTextValueChange(_minValue.toStringAsFixed(0)); } else if (_value < _minValue) {
onValueChange(_minValue); onTextValueChange(_minValue.toStringAsFixed(0));
return; onValueChange(_minValue);
} else if (_value >= _minValue && _value <= _maxValue) { return;
onValueChange(_value); } else if (_value >= _minValue && _value <= _maxValue) {
return; onValueChange(_value);
} return;
}, }
inputFormatters: [ },
FilteringTextInputFormatter.allow(RegExp(r'[0-9]')), inputFormatters: [
], FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
style: TextStyle( ],
style: TextStyle(
color: Color(0xff575757),
letterSpacing: -0.56,
),
decoration: InputDecoration(
isDense: true,
hintText: "0",
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757), color: Color(0xff575757),
letterSpacing: -0.56, letterSpacing: -0.56,
), ),
decoration: InputDecoration( contentPadding: EdgeInsets.zero,
isDense: true, border: InputBorder.none,
hintText: "0", focusedBorder: InputBorder.none,
hintStyle: TextStyle( enabledBorder: InputBorder.none,
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
), ),
], ),
), ],
), ),
Container(height: 34, width: 1, color: Color(0xffE0E0E0), margin: EdgeInsets.only(left: 12, right: 12)), ),
Expanded( Container(height: 34, width: 1, color: Color(0xffE0E0E0), margin: EdgeInsets.only(left: 12, right: 12)),
flex: 1, Expanded(
child: PopupMenuButton( flex: 1,
child: _commonDropDownView(TranslationBase.of(context).unit, unitTitle, null), child: PopupMenuButton(
onSelected: (value) { child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null),
onUnitTap(value); onSelected: (value) {
}, onUnitTap(value);
itemBuilder: (context) => _list), },
) itemBuilder: (context) => _list),
], )
), ],
); ).withBorderedContainer;
} }
void _updateUserDetails() async { void _updateUserDetails() async {
@ -627,3 +568,65 @@ class _H2oSettingState extends State<H2oSetting> {
}); });
} }
} }
// todo 'sikander' move these to separate file once usability known
class CommonDropDownView extends StatelessWidget {
final String title;
final String value;
final VoidCallback callback;
final IconData iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: callback,
child: Row(
children: [
Expanded(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(
title,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.44,
),
),
Text(
value,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
),
]),
),
Icon(
iconData ?? Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
],
),
);
}
}
extension BorderedContainer on Widget {
Widget get withBorderedContainer => 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: this,
);
}

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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';
@ -18,9 +17,6 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:wave/config.dart'; import 'package:wave/config.dart';
import 'package:wave/wave.dart'; import 'package:wave/wave.dart';
import 'Dialog/confirm_add_amount_dialog.dart';
import 'add_custom_amount.dart';
class TodayPage extends StatefulWidget { class TodayPage extends StatefulWidget {
TodayPage({Key key}) : super(key: key); TodayPage({Key key}) : super(key: key);

@ -1,201 +0,0 @@
import 'dart:math' as math;
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import '../add_custom_amount.dart';
// todo 'sikander' remove useless code
// class H20FloatingActionButton extends StatefulWidget {
// const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key);
//
// final H2OViewModel model;
//
// @override
// _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState();
// }
//
// class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin {
// AnimationController _controller;
// @override
// void initState() {
// _controller = new AnimationController(
// vsync: this,
// duration: const Duration(milliseconds: 500),
// );
// super.initState();
// }
//
// void showConfirmMessage(int amount, H2OViewModel model) {
// showDialog(
// context: context,
// child: ConfirmAddAmountDialog(
// model: model,
// amount: amount,
// ),
// );
// }
//
// @override
// Widget build(BuildContext context) {
// return Container(
// margin: EdgeInsets.only(left: 20, right: 20),
// child: new Column(mainAxisSize: MainAxisSize.min, children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Column(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// ActionButton(
// controller: _controller,
// text: "600${TranslationBase.of(context).ml}",
// onTap: () {
// showConfirmMessage(600, widget.model);
// },
// ),
// ActionButton(
// controller: _controller,
// text: "330${TranslationBase.of(context).ml}",
// onTap: () {
// showConfirmMessage(330, widget.model);
// },
// ),
// ActionButton(
// controller: _controller,
// text: "200${TranslationBase.of(context).ml}",
// onTap: () {
// showConfirmMessage(200, widget.model);
// },
// ),
// ],
// ),
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// FloatingActionButton(
// heroTag: null,
// child: new AnimatedBuilder(
// animation: _controller,
// builder: (BuildContext context, Widget child) {
// return new Transform(
// transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi),
// alignment: FractionalOffset.center,
// child: new Icon(_controller.isDismissed ? Icons.add : Icons.close),
// );
// },
// ),
// onPressed: () {
// if (_controller.isDismissed) {
// _controller.forward();
// } else {
// _controller.reverse();
// }
// },
// ),
// new Container(
// margin: EdgeInsets.only(left: 8, bottom: 4),
// alignment: FractionalOffset.topCenter,
// child: new ScaleTransition(
// scale: new CurvedAnimation(
// parent: _controller,
// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
// ),
// child: new FloatingActionButton(
// backgroundColor: Colors.white,
// heroTag: null,
// // mini: true,
// child: Text(
// TranslationBase.of(context).custom,
// textAlign: TextAlign.center,
// style: TextStyle(fontSize: 12, color: Colors.grey),
// ),
// onPressed: () {
// Navigator.push(
// context,
// FadePage(
// page: AddCustomAmount(
// model: widget.model,
// ),
// ),
// );
// },
// ),
// ),
// ),
// new Container(
// margin: EdgeInsets.only(left: 8, bottom: 4),
// alignment: FractionalOffset.topCenter,
// child: new ScaleTransition(
// scale: new CurvedAnimation(
// parent: _controller,
// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
// ),
// child: new FloatingActionButton(
// backgroundColor: Colors.white,
// heroTag: null,
// //mini: true,
// child: Text(
// TranslationBase.of(context).undo,
// textAlign: TextAlign.center,
// style: TextStyle(fontSize: 12.0, color: Colors.grey),
// ),
// onPressed: undoVolume,
// ),
// ),
// ),
// ],
// ),
// ]),
// );
// }
//
// void undoVolume() async {
// GifLoaderDialogUtils.showMyDialog(context);
// await widget.model.undoUserActivity();
// GifLoaderDialogUtils.hideDialog(context);
// }
// }
//
// class ActionButton extends StatelessWidget {
// const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap})
// : _controller = controller,
// super(key: key);
//
// final AnimationController _controller;
// final String text;
// final Function onTap;
//
// @override
// Widget build(BuildContext context) {
// return Container(
// margin: EdgeInsets.only(left: 4, bottom: 8),
// alignment: FractionalOffset.topCenter,
// child: new ScaleTransition(
// scale: new CurvedAnimation(
// parent: _controller,
// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
// ),
// child: new FloatingActionButton(
// heroTag: null,
// backgroundColor: Colors.white,
// //mini: true,
// child: Text(
// text,
// textAlign: TextAlign.center,
// style: TextStyle(fontSize: 12.0, color: Colors.grey),
// ),
// onPressed: onTap),
// ),
// );
// }
// }

@ -77,7 +77,6 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
width: 350.0, width: 350.0,
child: Text( child: Text(
TranslationBase.of(context).convertCholesterolStatement, TranslationBase.of(context).convertCholesterolStatement,
//textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0), style: TextStyle(fontSize: 20.0),
), ),
), ),
@ -90,7 +89,6 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
//crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 15.0), padding: const EdgeInsets.symmetric(horizontal: 15.0),

@ -50,18 +50,23 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
children: [ children: [
TabBar( TabBar(
controller: _tabController, controller: _tabController,
isScrollable: true, indicatorWeight: 3.0,
indicatorWeight: 4.0, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red, labelColor: Color(0xff2B353E),
labelColor: Theme.of(context).buttonColor, unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
unselectedLabelColor: Colors.grey,
labelStyle: TextStyle( labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: <Widget>[ tabs: <Widget>[
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,

@ -1,8 +1,8 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
//import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; //import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
@ -10,14 +10,15 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_mod
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectCiteisDialog.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/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_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';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -25,12 +26,6 @@ import 'package:flutter/material.dart';
import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:giffy_dialog/giffy_dialog.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'dialogs/SelectBeneficiaryDialog.dart';
import 'dialogs/SelectBloodDialog.dart';
import 'dialogs/SelectGenderDialog.dart';
import 'dialogs/SelectPatientFamilyDialog.dart';
import 'dialogs/SelectPatientInfoDialog.dart';
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
enum Gender { Male, Female, NON } enum Gender { Male, Female, NON }
enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON } enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON }
@ -44,11 +39,16 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
TextEditingController _fileTextController = TextEditingController(); TextEditingController _fileTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController(); TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON; BeneficiaryType beneficiaryType = BeneficiaryType.NON;
Gender gender = Gender.Male; //Gender.NON;
Blood blood = Blood.Aminus; //Blood.NON; // Gender gender = Gender.Male; //Gender.NON;
// Blood blood = Blood.Aminus; //Blood.NON;
//HospitalsModel _selectedHospital; //HospitalsModel _selectedHospital;
CitiesModel _selectedHospital; CitiesModel _selectedHospital;
int _selectedHospitalIndex = 0;
int _selectedGenderIndex = 1;
int _selectedBloodTypeIndex = 0;
String amount = ""; String amount = "";
String email; String email;
PatientInfo _selectedPatientInfo; PatientInfo _selectedPatientInfo;
@ -69,7 +69,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'), ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'),
); );
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectProvider.isLogin) getAuthUser(); if (projectProvider.isLogin) authUser = projectProvider.user;
}); });
super.initState(); super.initState();
} }
@ -79,404 +79,240 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getCities(), //model.getHospitals(), onModelReady: (model) {
model.getCities();
model.getBlood();
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, backgroundColor: Color(0xffF7F7F7),
baseViewModel: model, showNewAppBarTitle: true,
imagesInfo: imagesInfo, baseViewModel: model,
description: TranslationBase.of(context).bloodDonationInfo, imagesInfo: imagesInfo,
appBarTitle: TranslationBase.of(context).bloodD, description: TranslationBase.of(context).bloodDonationInfo,
body: SingleChildScrollView( appBarTitle: TranslationBase.of(context).bloodD,
physics: ScrollPhysics(), body: Column(
child: Container( children: [
margin: EdgeInsets.all(12), Expanded(
child: Column( child: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, physics: BouncingScrollPhysics(),
children: [ padding: EdgeInsets.all(21),
Texts( child: Column(
TranslationBase.of(context).bloodDEnterDesc crossAxisAlignment: CrossAxisAlignment.start,
), children: [
SizedBox( Text(
height: 12, TranslationBase.of(context).bloodDEnterDesc,
), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
InkWell(
onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),
//model.hospitals
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(getHospitalName(projectProvider, context), color: Colors.black), Icon(Icons.arrow_drop_down)],
),
),
),
SizedBox(
height: 12,
),
InkWell(
//======Gender========
onTap: () => confirmSelectGenderDialog(),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getGender(context), color: Colors.black),
Icon(Icons.arrow_drop_down)
],
),
), ),
), SizedBox(height: 12),
SizedBox( CommonDropDownView(
height: 12, TranslationBase.of(context).city,
), model.bloodModelList.isNotEmpty
InkWell( ? model.bloodModelList[0].city
//======Gender======== : projectProvider.isArabic
onTap: () => confirmSelectBloodDialog(), ? model.CitiesModelList[_selectedHospitalIndex].descriptionN
child: Container( : model.CitiesModelList[_selectedHospitalIndex].description, () {
padding: EdgeInsets.all(12), List<RadioSelectionDialogModel> list = [
width: double.infinity, for (int i = 0; i < model.CitiesModelList.length; i++)
height: 65, RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), ];
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, showDialog(
children: [Texts(getBlood(), color: Colors.black), Icon(Icons.arrow_drop_down)], context: context,
), child: RadioSelectionDialog(
), listData: list,
), selectedIndex: _selectedHospitalIndex,
SizedBox( isScrollable: true,
height: 12, onValueSelected: (index) {
), _selectedHospitalIndex = index;
Row( _selectedHospital = model.CitiesModelList[index];
mainAxisAlignment: MainAxisAlignment.spaceBetween, },
children: [ ),
Container( );
child: Text( }).withBorderedContainer,
SizedBox(height: 12),
CommonDropDownView(TranslationBase.of(context).gender, _selectedGenderIndex == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female, () {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(TranslationBase.of(context).male, 1),
RadioSelectionDialogModel(TranslationBase.of(context).female, 2),
];
showDialog(
context: context,
child: RadioSelectionDialog(
listData: list,
selectedIndex: _selectedGenderIndex,
onValueSelected: (index) {
_selectedGenderIndex = index;
setState(() {});
},
),
);
}).withBorderedContainer,
SizedBox(height: 12),
CommonDropDownView(TranslationBase.of(context).bloodType, model.bloodModelList.isNotEmpty ? model.bloodModelList[0].bloodGroup : getBlood(_selectedBloodTypeIndex), () {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel("O+", 0),
RadioSelectionDialogModel("O-", 1),
RadioSelectionDialogModel("AB+", 2),
RadioSelectionDialogModel("AB-", 3),
RadioSelectionDialogModel("A+", 4),
RadioSelectionDialogModel("A-", 5),
RadioSelectionDialogModel("B+", 6),
RadioSelectionDialogModel("B-", 7),
];
showDialog(
context: context,
child: RadioSelectionDialog(
listData: list,
selectedIndex: _selectedBloodTypeIndex,
isScrollable: true,
onValueSelected: (index) {
_selectedBloodTypeIndex = index;
setState(() {});
},
),
);
}).withBorderedContainer,
SizedBox(height: 12),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).viewTermsConditions + ":", TranslationBase.of(context).viewTermsConditions + ":",
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xff2E303A), fontSize: 14, letterSpacing: -0.56),
), ),
), InkWell(
InkWell( onTap: () {
onTap: () { Navigator.of(context).push(FadePage(page: UserAgreementPage()));
Navigator.of(context).push(FadePage(page: UserAgreementPage())); },
}, child: Text(
child: Container(
child: Texts(
TranslationBase.of(context).clickHere, TranslationBase.of(context).clickHere,
color: Colors.blue, style: TextStyle(fontWeight: FontWeight.w600, color: Colors.blue, fontSize: 14, letterSpacing: -0.56),
fontSize: 14.0,
), ),
)
],
),
SizedBox(height: 12),
Row(
children: [
Checkbox(
onChanged: (bool value) {
setState(() {
checkedValue = value;
});
},
value: checkedValue,
activeColor: Color(0xFFc5272d),
),
Text(
TranslationBase.of(context).iAgreeToTheTermsAndConditions,
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
), ),
) ],
], ),
), SizedBox(
SizedBox( height: 10,
height: 12, ),
), Row(
Row( mainAxisAlignment: MainAxisAlignment.center,
children: [ crossAxisAlignment: CrossAxisAlignment.center,
Checkbox( children: [
onChanged: (bool value) { Center(
setState(() { child: Container(
checkedValue = value; color: Theme.of(context).primaryColor,
}); width: 350,
}, child: InkWell(
value: checkedValue, onTap: () {
activeColor: Color(0xFFc5272d), showDialog(
), context: context,
Text( builder: (_) => AssetGiffyDialog(
TranslationBase.of(context).iAgreeToTheTermsAndConditions, title: Text(
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), "",
), style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
], ),
), image: Image.asset('assets/images/BloodChrt_EN.png'),
SizedBox( buttonCancelText: Text(TranslationBase.of(context).cancel),
height: 10, buttonCancelColor: Colors.grey,
), onlyCancelButton: true,
Row( ));
mainAxisAlignment: MainAxisAlignment.center, },
crossAxisAlignment: CrossAxisAlignment.center, child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white),
children: [ ),
Center(
child: Container(
color: Theme.of(context).primaryColor,
width: 350,
child: InkWell(
onTap: () {
showDialog(
context: context,
builder: (_) => AssetGiffyDialog(
title: Text(
"",
style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
),
image: Image.asset('assets/images/BloodChrt_EN.png'),
buttonCancelText: Text(TranslationBase.of(context).cancel),
buttonCancelColor: Colors.grey,
onlyCancelButton: true,
));
},
child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white),
), ),
), ),
), ],
], ),
), SizedBox(
SizedBox( height: MediaQuery.of(context).size.height * 0.15,
height: MediaQuery.of(context).size.height * 0.15, )
) ],
], ),
), ),
), ),
), DefaultButton(
bottomSheet: Container( TranslationBase.of(context).save,
width: double.infinity, checkedValue
color: Theme.of(context).scaffoldBackgroundColor, ? () async {
padding: EdgeInsets.all(20), if (_selectedHospital == null) {
child: DefaultButton(TranslationBase.of(context).save, () async { AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
if (_selectedHospital == null) { return;
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); }
return; bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;
} bloodDetails.cityCode = _selectedHospital.iD.toString();
bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; bloodDetails.gender = _selectedGenderIndex;
bloodDetails.cityCode = _selectedHospital.iD.toString(); bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex);
bloodDetails.gender = gender == Gender.Male ? 1 : 2; await model.updateBloodGroup(bloodDetails);
await model.updateBloodGroup(bloodDetails); if (model.state == ViewState.Idle) {
if (model.state == ViewState.Idle) { AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage);
AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); } else {
} else { AppToast.showErrorToast(message: model.error);
AppToast.showErrorToast(message: model.error); }
} }
}), : null,
)), disabledColor: CustomColors.grey2,
); ).insideContainer
} ],
),
void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) {
showDialog(
context: context,
child: SelectBeneficiaryDialog(
beneficiaryType: beneficiaryType,
onValueSelected: (value) {
setState(() {
if (value == BeneficiaryType.MyAccount) {
_fileTextController.text = model.user.patientID.toString();
advanceModel.depositorName = model.user.firstName + " " + model.user.lastName;
} else
_fileTextController.text = "";
beneficiaryType = value;
});
},
),
);
}
void confirmSelectBloodDialog() {
showDialog(
context: context,
child: SelectBloodDialog(
bloodType: blood,
onValueSelected: (value) {
setState(() {
if (value == Blood.Oplus) {
bloodDetails.bloodGroup = "O+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.Ominus) {
// _fileTextController.text = model.user.patientID.toString();
bloodDetails.bloodGroup = "O-";
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.ABplus) {
bloodDetails.bloodGroup = "AB+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.ABminus) {
bloodDetails.bloodGroup = "AB-";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.Aplus) {
bloodDetails.bloodGroup = "A+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.Aminus) {
bloodDetails.bloodGroup = "A-";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.Bplus) {
bloodDetails.bloodGroup = "B+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.Bminus) {
bloodDetails.bloodGroup = "B-";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else
_fileTextController.text = "";
// beneficiaryType = value;
blood = value;
});
},
),
);
}
void confirmSelectGenderDialog() {
showDialog(
context: context,
child: SelectGenderDialog(
beneficiaryType: gender,
onValueSelected: (value) {
setState(() {
if (value == Gender.Male) {
// _fileTextController.text = model.user.patientID.toString();
bloodDetails.patientType = 1;
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else
// _fileTextController.text = "";
{
bloodDetails.gender = 2;
}
// beneficiaryType = value;
gender = value;
});
},
), ),
); );
} }
//void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) { String getBlood(int index) {
void confirmSelectHospitalDialog(List<CitiesModel> hospitals) { switch (index) {
showDialog( case 0:
context: context,
child: SelectCiteisDialog(
hospitals: hospitals,
selectedHospital: _selectedHospital,
onValueSelected: (value) {
setState(() {
_selectedHospital = value;
});
},
),
);
}
void confirmSelectPatientDialog(List<PatientInfo> patientInfoList) {
showDialog(
context: context,
child: SelectPatientInfoDialog(
patientInfoList: patientInfoList,
selectedPatientInfo: _selectedPatientInfo,
onValueSelected: (value) {
setState(() {
advanceModel.depositorName = value.fullName;
_selectedPatientInfo = value;
});
},
),
);
}
void confirmSelectFamilyDialog(List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
showDialog(
context: context,
child: SelectPatientFamilyDialog(
getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList,
selectedPatientFamily: selectedPatientFamily,
onValueSelected: (value) {
setState(() {
selectedPatientFamily = value;
_fileTextController.text = selectedPatientFamily.patientID.toString();
advanceModel.depositorName = value.patientName;
});
},
),
);
}
String getBeneficiaryType() {
switch (beneficiaryType) {
case BeneficiaryType.MyAccount:
return TranslationBase.of(context).myAccount;
case BeneficiaryType.MyFamilyFiles:
return TranslationBase.of(context).myFamilyFiles;
break;
case BeneficiaryType.OtherAccount:
return TranslationBase.of(context).otherAccount;
break;
case BeneficiaryType.NON:
return TranslationBase.of(context).selectBeneficiary;
}
return TranslationBase.of(context).selectBeneficiary;
}
String getGender(BuildContext context) {
switch (gender) {
case Gender.Male:
return TranslationBase.of(context).male;
case Gender.Female:
return TranslationBase.of(context).female;
break;
case Gender.NON:
return TranslationBase.of(context).selectGender;
}
return TranslationBase.of(context).selectGender;
}
String getBlood() {
switch (blood) {
case Blood.Oplus:
return "O+"; return "O+";
break; break;
case Blood.Ominus: case 1:
return "O-"; return "O-";
break; break;
case Blood.ABplus: case 2:
return "AB+"; return "AB+";
break; break;
case Blood.ABminus: case 3:
return "AB-"; return "AB-";
break; break;
case Blood.Aplus: case 4:
return "A+"; return "A+";
break; break;
case Blood.Aminus: case 5:
return "A-"; return "A-";
break; break;
case Blood.Bplus: case 6:
return "B-"; return "B-";
break; break;
case Blood.Bminus: case 7:
return "B-"; return "B-";
break; break;
case Blood.Bplus: case 8:
return "B+"; return "B+";
break; break;
case Blood.NON: default:
return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary; return "";
} }
return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary;
} }
String getHospitalName(ProjectViewModel projectProvider, BuildContext context) { String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {
@ -484,32 +320,5 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;
else else
return TranslationBase.of(context).selectCity; return TranslationBase.of(context).selectCity;
// return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital;
}
String getPatientName() {
if (_selectedPatientInfo != null)
return _selectedPatientInfo.fullName;
else
return TranslationBase.of(context).selectPatientName;
} }
getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
setState(() {
authUser = data;
});
}
}
String getFamilyMembersName() {
if (selectedPatientFamily != null)
return selectedPatientFamily.patientName;
else
return TranslationBase.of(context).selectFamilyPatientName;
}
//================
} }

@ -193,7 +193,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
TextField( TextField(
enabled: isEnable, enabled: isEnable,
scrollPadding: EdgeInsets.zero, scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number, keyboardType: TextInputType.text,
controller: _controller, controller: _controller,
onChanged: (value) => {_onDocTextChanged(value)}, onChanged: (value) => {_onDocTextChanged(value)},
style: TextStyle( style: TextStyle(

@ -60,7 +60,7 @@ class _ChildPageState extends State<ChildVaccinePage> with SingleTickerProviderS
borderRadius: BorderRadius.all(Radius.circular(12)), borderRadius: BorderRadius.all(Radius.circular(12)),
color: Colors.white, color: Colors.white,
gradient: LinearGradient( gradient: LinearGradient(
colors: model.babyInformationModelList[index].gender == 1 colors: model.babyInformationModelList[index].gender == 2
? [ ? [
Color(0xFFFDA4B0), Color(0xFFFDA4B0),
Color(0xFFFBC8CC), Color(0xFFFBC8CC),
@ -94,7 +94,7 @@ class _ChildPageState extends State<ChildVaccinePage> with SingleTickerProviderS
), ),
), ),
Text( Text(
model.babyInformationModelList[index].gender == 1 ? TranslationBase.of(context).female : TranslationBase.of(context).male, model.babyInformationModelList[index].genderDescription,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
color: selectedColor, color: selectedColor,

@ -1,76 +0,0 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// todo 'sikander' remove useless code
// class ConfirmExitPageDialog extends StatelessWidget {
// final GestureTapCallback onTapYes;
// final GestureTapCallback onTapNo;
//
// const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo})
// : super(key: key);
//
// @override
// Widget build(BuildContext context) {
// return SimpleDialog(
// contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
// title: Center(
// child: Texts(
// TranslationBase.of(context).confirm,
// color: Colors.black,
// ),
// ),
// children: [
// Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Texts(
// "Are you sure you want to exit this page ?",
// color: Colors.grey,
// ),
// SizedBox(
// height: 5,
// ),
// Divider(),
// SizedBox(
// height: 5.0,
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// InkWell(
// onTap: () {
// onTapNo();
// },
// child: Container(
// child: Center(
// child: Texts(
// TranslationBase.of(context).no,
// color: Colors.red,
// ),
// ),
// ),
// ),
//
// InkWell(
// onTap: () {
// Navigator.pop(context);
// onTapYes();
// },
// child: Container(
// child: Center(
// child: Texts(TranslationBase.of(context).yes),
// ),
// ),
// ),
// ],
// ),
// SizedBox(
// height: 20.0,
// ),
// ],
// )
// ],
// );
// }
// }

@ -5,8 +5,6 @@ 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 'package:provider/provider.dart';
import 'ConfirmExitPageDialog.dart';
import 'EdOnlineAgreementPage.dart'; import 'EdOnlineAgreementPage.dart';
import 'EdOnlineNotesPage.dart'; import 'EdOnlineNotesPage.dart';
import 'EdOnlineQuestionsPage.dart'; import 'EdOnlineQuestionsPage.dart';
@ -104,21 +102,4 @@ class _DdServicesPageState extends State<DdServicesPage> {
), ),
); );
} }
// todo 'sikander' remove useless code
// void showConfirmMessage(
// BuildContext context,
// ) {
// showDialog(
// context: context,
// child: ConfirmExitPageDialog(
// onTapYes: () {
// Navigator.pop(context);
// },
// onTapNo: () {
// Navigator.pop(context);
// },
// ),
// );
// }
} }

@ -5,7 +5,6 @@ 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/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';
class PaymentMethod extends StatefulWidget { class PaymentMethod extends StatefulWidget {
Function onSelectedMethod; Function onSelectedMethod;
@ -37,7 +36,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.fromLTRB(4, 15.0, 4, 0.0), margin: EdgeInsets.fromLTRB(4, 15.0, 4, 0.0),
child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)), child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)),
), ),
Container( Container(
@ -70,15 +68,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
child: Image.asset("assets/images/new/payment/Mada.png"), child: Image.asset("assets/images/new/payment/Mada.png"),
), ),
// mWidth(12),
// Text(
// "Mada",
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontWeight: FontWeight.bold,
// ),
// ),
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "MADA") if (selectedPaymentMethod == "MADA")
Container( Container(
@ -128,16 +117,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60, width: 60,
child: Image.asset("assets/images/new/payment/visa.png"), child: Image.asset("assets/images/new/payment/visa.png"),
), ),
// mWidth(12),
// Text(
// "VISA",
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontWeight: FontWeight.bold,
// ),
// )
// ,
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "VISA") if (selectedPaymentMethod == "VISA")
Container( Container(
@ -187,15 +166,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60, width: 60,
child: Image.asset("assets/images/new/payment/Mastercard.png"), child: Image.asset("assets/images/new/payment/Mastercard.png"),
), ),
// mWidth(12),
// Text(
// "MasterCard",
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontWeight: FontWeight.bold,
// ),
// ),
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "MASTERCARD") if (selectedPaymentMethod == "MASTERCARD")
Container( Container(
@ -245,15 +215,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60, width: 60,
child: Image.asset("assets/images/new/payment/installments.png"), child: Image.asset("assets/images/new/payment/installments.png"),
), ),
// mWidth(12),
// Text(
// "Installments",
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontWeight: FontWeight.bold,
// ),
// ),
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "Installment") if (selectedPaymentMethod == "Installment")
Container( Container(
@ -304,15 +265,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60, width: 60,
child: Image.asset("assets/images/new/payment/Apple_Pay.png"), child: Image.asset("assets/images/new/payment/Apple_Pay.png"),
), ),
// mWidth(12),
// Text(
// "Apple Pay",
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontWeight: FontWeight.bold,
// ),
// ),
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "ApplePay") if (selectedPaymentMethod == "ApplePay")
Container( Container(
@ -332,40 +284,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
) )
// Container(
// margin: EdgeInsets.only(top: 25.0),
// child: Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// child: Container(
// child: InkWell(
// onTap: () {
// updateSelectedPaymentMethod("ApplePay");
// },
// child: Card(
// elevation: 3.0,
// margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
// ),
// child: Container(
// height: 120.0,
// padding: EdgeInsets.all(20.0),
// child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
// ),
// ),
// ),
// ),
// ),
// Expanded(
// child: Container(),
// ),
// ],
// ),
// )
: Container(), : Container(),
SizedBox( SizedBox(
height: 150.0, height: 150.0,

@ -498,42 +498,6 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
); );
return; return;
// todo 'sikander' remove useless code
// showDialog(
// context: context,
// child: FeedbackTypeDialog(
// messageTypeDialog: messageType,
// onValueSelected: (MessageType value) {
// if (value == MessageType.ComplaintOnAnAppointment) {
// appoList.clear();
// GifLoaderDialogUtils.showMyDialog(context);
// service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) {
// GifLoaderDialogUtils.hideDialog(context);
// setState(() {
// if (res['MessageStatus'] == 1) {
// if (res['AppoimentAllHistoryResultList'].length != 0) {
// res['AppoimentAllHistoryResultList'].forEach((v) {
// appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
// });
// setState(() {
// appointHistory = null;
// isShowListAppointHistory = true;
// });
// } else {}
// } else {}
// });
// }).catchError((err) {
// GifLoaderDialogUtils.hideDialog(context);
// // print(err);
// // AppToast.showErrorToast(message: err);
// // Navigator.of(context).pop();
// });
// } else {
// isShowListAppointHistory = false;
// }
// setMessageType(value);
// },
// ));
} }
openSpeechReco() async { openSpeechReco() async {
@ -587,238 +551,3 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (!mounted) return; if (!mounted) return;
} }
} }
// todo 'sikander' remove useless code
// class FeedbackTypeDialog extends StatefulWidget {
// final Function(MessageType) onValueSelected;
// final MessageType messageTypeDialog;
//
// const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key);
//
// @override
// State createState() => new FeedbackTypeDialogState();
// }
//
// class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
// MessageType messageTypeDialog = MessageType.NON;
//
// setMessageDialogType(MessageType messageType) {
// setState(() {
// messageTypeDialog = messageType;
// });
// }
//
// @override
// void initState() {
// messageTypeDialog = widget.messageTypeDialog;
//
// super.initState();
// }
//
// Widget build(BuildContext context) {
// return BaseView<FeedbackViewModel>(
// builder: (_, model, widge) => SimpleDialog(
// title: Text(
// TranslationBase.of(context).messageType,
// textAlign: TextAlign.center,
// ),
// children: <Widget>[
// Container(
// // padding: const EdgeInsets.all(10.0),
// child: Column(
// children: <Widget>[
// Divider(
// height: 2.5,
// color: Colors.grey[500],
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.NON),
// child: ListTile(
// title: Texts(TranslationBase.of(context).notClassified),
// leading: Radio(
// value: MessageType.NON,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment),
// child: ListTile(
// title: Texts(TranslationBase.of(context).complainAppo),
// leading: Radio(
// value: MessageType.ComplaintOnAnAppointment,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment),
// child: ListTile(
// title: Texts(TranslationBase.of(context).complainWithoutAppo),
// leading: Radio(
// value: MessageType.ComplaintWithoutAppointment,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.Question),
// child: ListTile(
// title: Texts(TranslationBase.of(context).question),
// leading: Radio(
// value: MessageType.Question,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.Compliment),
// child: ListTile(
// title: Texts(TranslationBase.of(context).compliment),
// leading: Radio(
// value: MessageType.Compliment,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.Suggestion),
// child: ListTile(
// title: Texts(TranslationBase.of(context).suggestion),
// leading: Radio(
// value: MessageType.Suggestion,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Divider(
// height: 2.5,
// color: Colors.grey[500],
// ),
// SizedBox(
// height: 5,
// ),
// Row(
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () {
// Navigator.pop(context);
// },
// child: Padding(
// padding: EdgeInsets.all(8.0),
// child: Container(
// child: Center(
// child: Texts(
// TranslationBase.of(context).cancel,
// color: CustomColors.accentColor,
// ),
// ),
// ),
// ),
// ),
// ),
// Container(
// width: 1,
// height: 30,
// color: Colors.grey[500],
// ),
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () {
// widget.onValueSelected(messageTypeDialog);
// Navigator.pop(context);
// },
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Center(
// child: Texts(
// TranslationBase.of(context).ok,
// fontWeight: FontWeight.w400,
// )),
// ),
// )),
// ],
// )
// ],
// ),
// ),
// ],
// ),
// );
// }
// }

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/gradient_color.dart';
import 'package:diplomaticquarterapp/models/hmg_services.dart'; import 'package:diplomaticquarterapp/models/hmg_services.dart';
import 'package:diplomaticquarterapp/models/slider_data.dart'; import 'package:diplomaticquarterapp/models/slider_data.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart';
@ -236,7 +237,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
), ),
FlatButton( FlatButton(
onPressed: () { onPressed: () {
Navigator.push(context, FadePage(page: AllHabibMedicalService())); Navigator.push(context, FadePage(page: AllHabibMedicalSevicePage2()));
}, },
child: Text( child: Text(
TranslationBase.of(context).viewAllServices, TranslationBase.of(context).viewAllServices,

@ -388,13 +388,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
); );
} }
// todo 'sikander' remove useless code
// showDialogs(String message) {
// ConfirmDialog dialog = new ConfirmDialog(
// context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {});
// dialog.showAlertDialog(context);
// }
Future<Map<Permission, PermissionStatus>> requestPermissions() async { Future<Map<Permission, PermissionStatus>> requestPermissions() async {
var permissionResults = [ var permissionResults = [
Permission.location, Permission.location,

@ -4,10 +4,9 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart'; import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart';
import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/pages/search_products_page.dart';
@ -146,9 +145,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
try { try {
String barcode = result; String barcode = result;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient() await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) {
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",
onSuccess: (dynamic response, int statusCode) {
print(response); print(response);
var product = PharmacyProduct.fromJson(response["products"][0]); var product = PharmacyProduct.fromJson(response["products"][0]);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -158,8 +155,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
AppToast.showErrorToast(message: "Product not found"); AppToast.showErrorToast(message: "Product not found");
}); });
} catch (apiEx) { } catch (apiEx) {
AppToast.showErrorToast( AppToast.showErrorToast(message: "Something went wrong, please try again");
message: "Something went wrong, please try again");
} }
} catch (barcodeEx) {} } catch (barcodeEx) {}
} }

@ -107,7 +107,7 @@ class ServicesView extends StatelessWidget {
FadePage(page: ChildInitialPage()), FadePage(page: ChildInitialPage()),
); );
} else if (index == 15) { } else if (index == 15) {
Navigator.pop(context); // Navigator.pop(context);
LandingPage.shared.switchToDoFromHMGServices(); LandingPage.shared.switchToDoFromHMGServices();
} else if (index == 16) { } else if (index == 16) {
Navigator.push( Navigator.push(

@ -1,7 +1,5 @@
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/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingRequest.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingRequest.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart';
@ -62,7 +60,24 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
body: Container( body: Container(
child: Column(children: [ child: Column(children: [
TabBar( TabBar(
labelColor: Colors.black, controller: _tabController,
indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 0, bottom: 0, left: 20, right: 20),
labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [ tabs: [
Tab( Tab(
child: Text( child: Text(
@ -87,7 +102,6 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
), ),
), ),
], ],
controller: _tabController,
), ),
Expanded( Expanded(
child: TabBarView( child: TabBarView(

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.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/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';
@ -28,188 +29,71 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
appBarTitle: TranslationBase.of(context).livecare.toUpperCase(), appBarTitle: TranslationBase.of(context).livecare.toUpperCase(),
// appBar: AppBar(
// leading: InkWell(
// onTap: () {
// Navigator.pop(context, null);
// },
// child: Icon(
// Icons.close,
// color: Colors.white,
// ),
// ),
// title: Text(TranslationBase.of(context).bookAppo,
// style: TextStyle(color: Colors.white)),
// ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0), margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container(child: Text(TranslationBase.of(context).livecareService, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))),
Container( Container(
alignment: Alignment.center, margin: EdgeInsets.only(top: 7.0),
margin: EdgeInsets.only(top: 15.0, bottom: 10.0), child: Text(TranslationBase.of(context).livecareServiceDesc, style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))),
child: Image.asset(
languageID == 'ar'
? "assets/images/new-design/liveCare_ar_bg.png"
: "assets/images/new-design/liveCare_en_bg.png",
width: 120),
),
Container(
alignment: Alignment.center,
child: Text(TranslationBase.of(context).livecareService,
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))),
Container(
margin: EdgeInsets.only(top: 0.0),
alignment: Alignment.center,
child: Text(
TranslationBase.of(context).livecareServiceDesc,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18.0))),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 20.0),
child: Text(TranslationBase.of(context).whyLivecare, child: Text(TranslationBase.of(context).whyLivecare, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))),
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))),
Container( Container(
margin: EdgeInsets.only(top: 0.0, left: 20.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg", SvgPicture.asset("assets/images/new-design/allow.svg", width: 20),
width: 25),
Container( Container(
width: MediaQuery.of(context).size.width * 0.72, width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0), margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text( child: Text(TranslationBase.of(context).livecarePoint1,
TranslationBase.of(context).livecarePoint1, overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0, letterSpacing: -0.64, color: CustomColors.black, fontWeight: FontWeight.w600)),
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
) )
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 5.0, left: 20.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg", SvgPicture.asset("assets/images/new-design/allow.svg", width: 20),
width: 25),
Container( Container(
width: MediaQuery.of(context).size.width * 0.72, width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0), margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text(TranslationBase.of(context).docVirtualAppoIns4, child: Text(TranslationBase.of(context).docVirtualAppoIns4,
overflow: TextOverflow.clip, overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0, letterSpacing: -0.64, color: CustomColors.black, fontWeight: FontWeight.w600)),
style: TextStyle(fontSize: 14.0)),
) )
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 5.0, left: 20.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg", SvgPicture.asset("assets/images/new-design/allow.svg", width: 20),
width: 25),
Container( Container(
width: MediaQuery.of(context).size.width * 0.72, width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0), margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text(TranslationBase.of(context).docVirtualAppoIns5, child: Text(TranslationBase.of(context).docVirtualAppoIns5,
overflow: TextOverflow.clip, overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0, letterSpacing: -0.64, color: CustomColors.black, fontWeight: FontWeight.w600)),
style: TextStyle(fontSize: 14.0)),
) )
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 20.0),
child: Text( child: Text(TranslationBase.of(context).livecareSummary, style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))),
TranslationBase.of(context).livecareSummary,
style: TextStyle(fontSize: 12.0))), GridView(
InkWell( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
onTap: (){ physics: NeverScrollableScrollPhysics(),
Navigator.pop(context, "immediate"); padding: EdgeInsets.only(top: 40.0),
}, shrinkWrap: true,
child: Container( children: [
decoration: BoxDecoration( _loginOptionButton(TranslationBase.of(context).livecareOption1, 'assets/images/new/Live_Care.svg', 1),
color: Colors.red[900], _loginOptionButton(TranslationBase.of(context).livecareOption4, 'assets/images/new/book appointment.svg', 2),
borderRadius: BorderRadius.all(Radius.circular(10.0))), ],
height: 100.0,
margin: EdgeInsets.only(top: 20.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: SvgPicture.asset(
"assets/images/new-design/liveCare_logo_icon_white.svg",
width: 80),
),
Container(
width: MediaQuery.of(context).size.width * 0.56,
margin: EdgeInsets.fromLTRB(30.0, 10.0, 0.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(TranslationBase.of(context).livecareOption1,
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
color: Colors.white)),
Container(
margin: EdgeInsets.only(top: 0.0),
child: Text(TranslationBase.of(context).livecareOption2, textAlign: TextAlign.start,
style: TextStyle(
fontSize: 18.0, color: Colors.white)),
)
],
),
),
],
)),
),
InkWell(
onTap: (){
Navigator.pop(context, "schedule");
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 100.0,
margin: EdgeInsets.only(top: 20.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: Image.asset(
"assets/images/new-design/calendar.png",
width: 60),
),
Container(
width: MediaQuery.of(context).size.width * 0.53,
margin: EdgeInsets.fromLTRB(30.0, 10.0, 0.0, 0.0),
child: Column(
children: <Widget>[
Container(
child: Text(TranslationBase.of(context).livecareOption3,
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
color: Colors.white)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).livecareOption4,
style: TextStyle(
fontSize: 18.0, color: Colors.white)),
)
],
),
),
],
)),
), ),
SizedBox( SizedBox(
height: 40.0, height: 40.0,
@ -221,6 +105,44 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
); );
} }
Widget _loginOptionButton(String _title, String _icon, int _loginIndex) {
return InkWell(
onTap: () {
if (_loginIndex == 1) {
Navigator.pop(context, "immediate");
} else {
Navigator.pop(context, "schedule");
}
},
child: Container(
padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
SvgPicture.asset(
_icon,
height: _loginIndex == 1 ? 60 : 50,
width: _loginIndex == 1 ? 60 : 50,
),
Text(
_title,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16),
),
],
),
),
);
}
getLanguageID() async { getLanguageID() async {
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
setState(() { setState(() {

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.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:flutter/material.dart'; import 'package:flutter/material.dart';
@ -14,11 +15,7 @@ class ClinicCard extends StatefulWidget {
var languageID; var languageID;
int isOnline; int isOnline;
ClinicCard( ClinicCard({this.isSelected, this.languageID, this.isOnline, @required this.patientERGetClinicsList});
{this.isSelected,
this.languageID,
this.isOnline,
@required this.patientERGetClinicsList});
@override @override
_State createState() => _State(); _State createState() => _State();
@ -35,90 +32,69 @@ class _State extends State<ClinicCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Container(
children: <Widget>[ width: double.infinity,
Card( margin: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 8.0),
margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), decoration: BoxDecoration(
color: widget.isSelected ? Color(0xff06b806) : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey, borderRadius: BorderRadius.all(
shape: RoundedRectangleBorder( Radius.circular(10.0),
borderRadius: BorderRadius.circular(10),
), ),
child: Container( border: Border.all(width: 2, color: widget.isSelected ? CustomColors.green : Color(0xffEFEFEF)),
width: MediaQuery.of(context).size.width * 0.75, boxShadow: [
padding: EdgeInsets.all(12.0), BoxShadow(
child: Column( color: Color(0xff000000).withOpacity(.05),
crossAxisAlignment: CrossAxisAlignment.start, blurRadius: 27,
mainAxisSize: MainAxisSize.max, offset: Offset(0, -3),
children: <Widget>[ ),
],
color: Colors.white),
child: Container(
padding: EdgeInsets.fromLTRB(12.0, 25.0, 12.0, 25.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
child: Text(widget.languageID == 'ar' ? widget.patientERGetClinicsList.serviceNameN : widget.patientERGetClinicsList.serviceName,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16)),
),
Row(
children: [
Container( Container(
child: Text( child: Text(".", style: TextStyle(fontSize: 30.0)),
widget.languageID == 'ar' ),
? widget.patientERGetClinicsList.serviceNameN Container(
: widget.patientERGetClinicsList.serviceName, child: Text("Online"),
style: TextStyle(
fontSize: 16.0,
color:
widget.isSelected ? Colors.white : Colors.black)),
), ),
], ],
), ),
), ],
),
InkWell(
onTap: () {
getClinicTimings(widget.patientERGetClinicsList);
},
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 10.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
child: Container(
padding: EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Icon(Icons.access_time, size: 26.0, color: Colors.red[800]),
],
),
),
),
), ),
], ),
); );
} }
getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) { getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) {
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context).then((res) {
.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
clinicsServiceTimingsResponse = clinicsServiceTimingsResponse = ClinicsServiceTimingsResponse.fromJson(res);
ClinicsServiceTimingsResponse.fromJson(res); print(clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList.length);
print(clinicsServiceTimingsResponse
.patientERGetClinicsServiceTimingsList.length);
showGeneralDialog( showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5), barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) { transitionBuilder: (context, a1, a2, widget) {
final curvedValue = final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform( return Transform(
transform: transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity( child: Opacity(
opacity: a1.value, opacity: a1.value,
child: ClinicTimingsDialog( child: ClinicTimingsDialog(
clinicName: patientERGetClinicsList.serviceName, clinicName: patientERGetClinicsList.serviceName,
patientERGetClinicsServiceTimingsList: patientERGetClinicsServiceTimingsList: clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList,
clinicsServiceTimingsResponse
.patientERGetClinicsServiceTimingsList,
), ),
), ),
); );

@ -76,11 +76,8 @@ class _clinic_listState extends State<ClinicList> {
if (LiveCareHome.isLiveCareTypeSelected != true) { if (LiveCareHome.isLiveCareTypeSelected != true) {
openLiveCareSelectionDialog(); openLiveCareSelectionDialog();
} else { } else {
print("LiveCare Type Selected");
setState(() { setState(() {
currentSelectedLiveCareType = "immediate"; currentSelectedLiveCareType = "immediate";
// isDataLoaded = true;
// print(liveCareOnlineClinicsListResponse.length);
getLiveCareClinicsList(); getLiveCareClinicsList();
}); });
} }
@ -440,33 +437,35 @@ class _clinic_listState extends State<ClinicList> {
isDataLoaded isDataLoaded
? Container( ? Container(
height: MediaQuery.of(context).size.height * 0.7, height: MediaQuery.of(context).size.height * 0.7,
child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length > 0 ? Column( child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length > 0
crossAxisAlignment: CrossAxisAlignment.start, ? Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
ListView.builder( children: <Widget>[
scrollDirection: Axis.vertical, ListView.builder(
shrinkWrap: true, scrollDirection: Axis.vertical,
physics: ScrollPhysics(), shrinkWrap: true,
padding: EdgeInsets.all(0.0), physics: ScrollPhysics(),
itemCount: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length, padding: EdgeInsets.all(0.0),
itemBuilder: (context, index) { itemCount: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length,
return InkWell( itemBuilder: (context, index) {
onTap: () { return InkWell(
updateSelectedScheduleIndex(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index]); onTap: () {
}, updateSelectedScheduleIndex(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index]);
child: ScheduleClinicCard( },
isSelected: selectedClinicID == liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index].serviceID ? true : false, child: ScheduleClinicCard(
clinicsHaveScheduleList: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index], isSelected: selectedClinicID == liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index].serviceID ? true : false,
languageID: languageID, clinicsHaveScheduleList: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index],
languageID: languageID,
),
);
},
), ),
); Container(
}, height: 10.0,
), ),
Container( ],
height: 10.0, )
), : getNoDataWidget(context),
],
): getNoDataWidget(context),
) )
: Container(), : Container(),
isDataLoaded isDataLoaded
@ -509,16 +508,11 @@ class _clinic_listState extends State<ClinicList> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Text(TranslationBase.of(context).onlineClinics, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0), padding: const EdgeInsets.only(top: 16.0),
// itemCount: liveCareClinicsListResponse.patientERGetClinicsList.length,
itemCount: liveCareOnlineClinicsListResponse.length, itemCount: liveCareOnlineClinicsListResponse.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
@ -533,10 +527,10 @@ class _clinic_listState extends State<ClinicList> {
); );
}, },
), ),
Container( // Container(
margin: EdgeInsets.all(15.0), // margin: EdgeInsets.all(15.0),
child: Text(TranslationBase.of(context).offlineClinics, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), // child: Text(TranslationBase.of(context).offlineClinics, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
), // ),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,

@ -1,3 +1,4 @@
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/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
@ -12,6 +13,7 @@ import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authent
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/login/register_new.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -21,6 +23,7 @@ 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/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/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -34,13 +37,12 @@ import 'package:intl/intl.dart';
import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/pages/login/register_new.dart';
class ConfirmLogin extends StatefulWidget { class ConfirmLogin extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
const ConfirmLogin({Key key, this.changePageViewIndex}) : super(key: key); const ConfirmLogin({Key key, this.changePageViewIndex}) : super(key: key);
@override @override
_ConfirmLogin createState() => _ConfirmLogin(); _ConfirmLogin createState() => _ConfirmLogin();
} }
@ -640,15 +642,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
if (result.isNeedUserAgreement == true) { if (result.isNeedUserAgreement == true) {
//move to agreement page. //move to agreement page.
} else { } else {
insertIMEI(); goToHome();
} }
} }
insertIMEI() { insertIMEI() {
authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}).catchError((err) { authService.insertDeviceImei(selectedOption).then((value) => {}).catchError((err) {
print(err); print(err);
}); });
// authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {});
} }
getToDoCount() { getToDoCount() {
@ -670,7 +671,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
getToDoCount(); // getToDoCount();
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
@ -694,13 +695,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
page: LandingPage(), page: LandingPage(),
), ),
(r) => false) (r) => false)
} },
insertIMEI()
}) })
.catchError((err) { .catchError((err) {
print(err); print(err);
//GifLoaderDialogUtils.hideDialog(context);
}); });
// SMSOTP.showLoadingDialog(context, false),
} }
loading(flag) { loading(flag) {
@ -752,37 +752,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
), ),
); );
// return InkWell(
// onTap: () {
// if (_flag == 0) {
// setState(() {
// isMoreOption = true;
// });
// } else {
// authenticateUser(4, isActive: _loginIndex);
// }
// },
// child: RoundedContainer(
// height: 150,
// borderColor: Colors.grey,
// showBorder: true,
// child: Padding(
// padding: EdgeInsets.fromLTRB(30, 15, 30, 15),
// child: Column(
// children: <Widget>[
// Image.asset(
// _icon,
// height: SizeConfig.imageSizeMultiplier * 13,
// width: SizeConfig.imageSizeMultiplier * 16,
// ),
// SizedBox(
// height: 20,
// ),
// Texts(_title, fontSize: SizeConfig.textMultiplier * 2, color: Colors.black)
// ],
// ),
// )));
} }
// todo 'sikander' optimize this after knowing usage // todo 'sikander' optimize this after knowing usage

@ -111,15 +111,6 @@ class AskDoctorPage extends StatelessWidget {
); );
} }
// todo 'sikander' remove this later
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
return docSpeciality;
}
String getDate(String date) { String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date); DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) + return DateUtil.getWeekDay(dateObj.weekday) +

@ -216,30 +216,6 @@ class _AddWeightPageState extends State<AddWeightPage> {
), ),
); );
return; return;
// todo 'sikander' remove useless code
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).removeMeasure,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model.deleteWeightResult(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}) })
], ],
), ),

@ -62,10 +62,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Flexible( Flexible(
// margin: EdgeInsets.only(top: 10.0),
child: CarouselSlider( child: CarouselSlider(
carouselController: buttonCarouselController, carouselController: buttonCarouselController,
options: CarouselOptions(enableInfiniteScroll: false, viewportFraction: 0.95, height: MediaQuery.of(context).size.height * 0.65), options: CarouselOptions(enableInfiniteScroll: false, viewportFraction: 0.95, height: MediaQuery.of(context).size.height * 0.9),
items: [1, 2].map((i) { items: [1, 2].map((i) {
return Builder( return Builder(
builder: (BuildContext context) { builder: (BuildContext context) {

@ -23,10 +23,9 @@ import 'cart-page/cart-order-preview.dart';
class CartOrderPage extends StatefulWidget { class CartOrderPage extends StatefulWidget {
final Function(int) changeTab;
const CartOrderPage({ Key key}) const CartOrderPage({Key key, this.changeTab}) : super(key: key);
: super(key: key);
@override @override
_CartOrderPageState createState() => _CartOrderPageState(); _CartOrderPageState createState() => _CartOrderPageState();
@ -50,10 +49,9 @@ class _CartOrderPageState extends State<CartOrderPage> {
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
AppScaffold appScaffold; AppScaffold appScaffold;
return NetworkBaseView( return NetworkBaseView(
// baseViewModel: model,
isLoading: isLoading, isLoading: isLoading,
isLocalLoader: true, isLocalLoader: true,
child: AppScaffold( child: appScaffold = AppScaffold(
appBarTitle: TranslationBase.of(context).shoppingCart, appBarTitle: TranslationBase.of(context).shoppingCart,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
@ -297,7 +295,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
Container( Container(
height: widget.height * 0.070, height: widget.height * 0.070,
color: Color(0xffe6ffe0), color: Color(0xffe6ffe0),
padding: EdgeInsets.symmetric(horizontal: 4), padding: EdgeInsets.only(left: 15.0, right: 15.0),
child: Row( child: Row(
children: [ children: [
InkWell( InkWell(
@ -357,7 +355,8 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
), ),
Container( Container(
height: widget.height * 0.065, height: widget.height * 0.065,
margin: EdgeInsets.symmetric(vertical: 2), margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
padding: EdgeInsets.only(left: 20.0, right: 20.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [

@ -1,420 +0,0 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-preview.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class CartOrderPage extends StatefulWidget {
final Function(int) changeTab;
const CartOrderPage({Key key, this.changeTab}) : super(key: key);
@override
_CartOrderPageState createState() => _CartOrderPageState();
}
class _CartOrderPageState extends State<CartOrderPage> {
bool isLoading = true;
@override
void initState() {
super.initState();
getData();
}
@override
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
OrderPreviewViewModel model = Provider.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
AppScaffold appScaffold;
return NetworkBaseView(
isLoading: isLoading,
isLocalLoader: true,
child: appScaffold = AppScaffold(
appBarTitle: TranslationBase.of(context).shoppingCart,
isShowAppBar: true,
isPharmacy: true,
showHomeAppBarIcon: false,
isShowDecPage: true,
baseViewModel: model,
backButtonTab:
widget.changeTab != null ? () => widget.changeTab(0) : null,
backgroundColor: Colors.white,
body: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0)
? Container(
height: height * 0.85,
width: double.infinity,
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureIconButton(
TranslationBase.of(context).deleteAllItems,
Icon(
Icons.delete_outline_sharp,
color: Colors.grey.shade700,
),
onTap: () => {model.deleteShoppingCart()},
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
child: Column(
children: [
...List.generate(
model.cartResponse.shoppingCarts != null
? model.cartResponse.shoppingCarts.length
: 0,
(index) => ProductOrderItem(
model.cartResponse
.shoppingCarts[index], () {
print(model.cartResponse
.shoppingCarts[index].quantity);
model
.changeProductQuantity(model
.cartResponse
.shoppingCarts[index])
.then((value) {
if (model.state != ViewState.Error) {
appScaffold.appBar.badgeUpdater(
'${value.quantityCount ?? 0}');
}
if (model.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
}
});
}, () {
model
.deleteProduct(model.cartResponse
.shoppingCarts[index])
.then((value) {
if (model.state != ViewState.Error) {
appScaffold.appBar.badgeUpdater(
'${value.quantityCount ?? 0}');
}
});
}))
],
),
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 2,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).subtotal,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
"${TranslationBase.of(context).vat}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Image.asset(
"assets/images/pharmacy_module/payment_image.png",
width: mediaQuery.size.width - 20,
height: 30.0,
fit: BoxFit.scaleDown,
),
SizedBox(
height: 120,
)
],
),
),
),
)
: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/new-design/empty_box.png',
width: 100,
height: 100,
fit: BoxFit.cover,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
TranslationBase.of(context).noData,
// 'There is no data',
style: TextStyle(fontSize: 30),
),
)
],
),
),
bottomSheet: Container(
height: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0)
? height * 0.15
: 0,
color: Colors.white,
child: OrderBottomWidget(model.addresses, height),
),
),
);
}
void getData() async {
await Provider.of<OrderPreviewViewModel>(context, listen: false)
.getShoppingCart();
setState(() {
isLoading = false;
});
}
}
class OrderBottomWidget extends StatefulWidget {
final List<Addresses> addresses;
final double height;
OrderBottomWidget(this.addresses, this.height);
@override
_OrderBottomWidgetState createState() => _OrderBottomWidgetState();
}
class _OrderBottomWidgetState extends State<OrderBottomWidget> {
bool isAgree = false;
@override
Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
OrderPreviewViewModel cart = Provider.of(context);
return !(cart.cartResponse.shoppingCarts == null ||
cart.cartResponse.shoppingCarts.length == 0)
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Divider(
color: Color(0xFFD6D6D6),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
height: widget.height * 0.070,
color: Color(0xffe6ffe0),
padding: EdgeInsets.symmetric(horizontal: 4),
child: Row(
children: [
InkWell(
onTap: () {
setState(() {
isAgree = !isAgree;
});
},
child: Container(
width: 25.0,
height: widget.height * 0.070,
decoration: new BoxDecoration(
color: !isAgree ? Color(0xffeeeeee) : Colors.green,
shape: BoxShape.circle,
),
child: !isAgree
? null
: Padding(
padding: const EdgeInsets.all(0.0),
child: Icon(
Icons.check,
color: Colors.white,
size: 25,
),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 4),
margin: const EdgeInsets.symmetric(vertical: 4),
child: Texts(
TranslationBase.of(context)
.pharmacyServiceTermsCondition,
fontSize: 13,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
),
),
InkWell(
onTap: () => {
Navigator.push(
context, FadePage(page: PharmacyTermsConditions()))
},
child: Container(
child: Icon(
Icons.info,
size: 25,
color: Color(0xff005aff),
),
),
),
],
),
),
Container(
height: widget.height * 0.065,
margin: EdgeInsets.symmetric(vertical: 2),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 0, vertical: 0),
child: Row(
children: [
Texts(
"${TranslationBase.of(context).sar} ${(cart.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: projectProvider.isArabic ? 12 : 14,
fontWeight: FontWeight.bold,
),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 4),
child: Texts(
"${TranslationBase.of(context).inclusiveVat}",
fontSize: 8,
color: Colors.grey,
fontWeight: FontWeight.bold,
),
),
],
),
),
Texts(
"${cart.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
fontSize: 10,
color: Colors.grey,
fontWeight: FontWeight.bold,
),
],
),
),
RaisedButton(
onPressed: isAgree
? () => {
Navigator.push(
context,
FadePage(
page:
OrderPreviewPage(widget.addresses)))
}
: null,
child: new Text(
"${TranslationBase.of(context).checkOut}",
style: new TextStyle(
color:
isAgree ? Colors.white : Colors.grey.shade300,
fontSize: 14),
),
elevation: 0,
color: Color(0xff005aff),
disabledColor: Color(0xff005aff),
),
],
),
),
],
)
: Container();
}
}

@ -1,26 +1,10 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.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 SelectPaymentOptionWidget extends StatefulWidget { class SelectPaymentOptionWidget extends StatefulWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
@ -28,24 +12,21 @@ class SelectPaymentOptionWidget extends StatefulWidget {
SelectPaymentOptionWidget(this.model); SelectPaymentOptionWidget(this.model);
@override @override
_SelectPaymentOptionWidgetState createState() => _SelectPaymentOptionWidgetState createState() => _SelectPaymentOptionWidgetState();
_SelectPaymentOptionWidgetState();
} }
class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> { class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
PaymentOption paymentOption; PaymentOption paymentOption;
_navigateToPaymentOption() { _navigateToPaymentOption() {
Navigator.push(context, FadePage(page: PaymentMethodSelectPage())) Navigator.push(context, FadePage(page: PaymentMethodSelectPage())).then((result) => {
.then((result) => { setState(() {
setState(() { if (result != null) {
if (result != null) { paymentOption = result;
paymentOption = result; widget.model.paymentCheckoutData.paymentOption = paymentOption;
widget.model.paymentCheckoutData.paymentOption = }
paymentOption; })
} });
})
});
} }
@override @override
@ -75,8 +56,7 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: padding: EdgeInsets.symmetric(vertical: 0, horizontal: 6),
EdgeInsets.symmetric(vertical: 0, horizontal: 6),
child: Texts( child: Texts(
TranslationBase.of(context).selectPaymentOption, TranslationBase.of(context).selectPaymentOption,
fontSize: 14, fontSize: 14,

@ -1,14 +1,16 @@
import 'dart:io';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.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/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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';
class PaymentMethodSelectPage extends StatefulWidget { class PaymentMethodSelectPage extends StatefulWidget {
@override @override
_PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState();
_PaymentMethodSelectPageState();
} }
class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> { class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
@ -20,8 +22,9 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
double cardWidth = screenSize.width / 2 - 32; double cardWidth = screenSize.width / 2 - 32;
return AppScaffold( return AppScaffold(
title: "Payment method", appBarTitle: TranslationBase.of(context).paymentMethod,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
@ -30,72 +33,65 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Center( Center(
child: Texts( child: Text(
TranslationBase.of(context).selectPaymentOption, TranslationBase.of(context).selectPaymentOption,
fontSize: 20, style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20,
color: Colors.black, fontWeight: FontWeight.bold,
color: Colors.black,
),
), ),
), ),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 0, vertical: 16), margin: EdgeInsets.symmetric(horizontal: 0, vertical: 16),
child: Column( child: Column(
children: [ children: [
Row(
children: [
PaymentMethodCard(
cardWidth,
selectedPaymentOption,
PaymentOption.meda,
() => {
setState(() {
selectedPaymentOption = PaymentOption.meda;
})
}),
PaymentMethodCard(
cardWidth,
selectedPaymentOption,
PaymentOption.sadad,
() => {
setState(() {
selectedPaymentOption = PaymentOption.sadad;
})
}),
],
),
Row(
children: [
PaymentMethodCard(
cardWidth,
selectedPaymentOption,
PaymentOption.visa,
() => {
setState(() {
selectedPaymentOption = PaymentOption.visa;
})
}),
PaymentMethodCard(
cardWidth,
selectedPaymentOption,
PaymentOption.mastercard,
() => {
setState(() {
selectedPaymentOption =
PaymentOption.mastercard;
})
}),
],
),
PaymentMethodCard( PaymentMethodCard(
(cardWidth * 2 + 32), cardWidth,
selectedPaymentOption,
PaymentOption.meda,
() => {
setState(() {
selectedPaymentOption = PaymentOption.meda;
})
}),
PaymentMethodCard(
cardWidth,
selectedPaymentOption,
PaymentOption.visa,
() => {
setState(() {
selectedPaymentOption = PaymentOption.visa;
})
}),
PaymentMethodCard(
cardWidth,
selectedPaymentOption,
PaymentOption.mastercard,
() => {
setState(() {
selectedPaymentOption = PaymentOption.mastercard;
})
}),
PaymentMethodCard(
cardWidth,
selectedPaymentOption, selectedPaymentOption,
PaymentOption.installments, PaymentOption.installments,
() => { () => {
setState(() { setState(() {
selectedPaymentOption = selectedPaymentOption = PaymentOption.installments;
PaymentOption.installments;
}) })
}), }),
if (Platform.isIOS)
PaymentMethodCard(
cardWidth,
selectedPaymentOption,
PaymentOption.applepay,
() => {
setState(() {
selectedPaymentOption = PaymentOption.applepay;
})
}),
], ],
), ),
), ),
@ -103,18 +99,12 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: screenSize.height * 0.08, color: Theme.of(context).scaffoldBackgroundColor,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: EdgeInsets.symmetric(horizontal: 16, vertical: 20),
child: BorderedButton( child: DefaultButton(
TranslationBase.of(context).next, TranslationBase.of(context).next,
backgroundColor: Color(0xff5AB154), selectedPaymentOption != null ? () => {Navigator.pop(context, selectedPaymentOption)} : null,
textColor: Colors.white, color: Color(0xff5AB154),
fontSize: 16,
hPadding: 8,
vPadding: 12,
handler: selectedPaymentOption != null
? () => {Navigator.pop(context, selectedPaymentOption)}
: null,
), ),
), ),
); );
@ -127,61 +117,102 @@ class PaymentMethodCard extends StatelessWidget {
final PaymentOption paymentOption; final PaymentOption paymentOption;
final Function selectMethod; final Function selectMethod;
PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, this.paymentOption, this.selectMethod);
this.paymentOption, this.selectMethod);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isSelected = false; bool isSelected = false;
if (selectedPaymentOption != null && if (selectedPaymentOption != null && selectedPaymentOption == paymentOption) {
selectedPaymentOption == paymentOption) {
isSelected = true; isSelected = true;
} }
return InkWell( return Container(
onTap: selectMethod, width: MediaQuery.of(context).size.width * 0.99,
child: Container( child: InkWell(
margin: EdgeInsets.symmetric(horizontal: 2, vertical: 0), onTap: selectMethod,
child: Stack( child: Card(
children: [ elevation: 0.0,
Container( margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), color: Colors.white,
margin: EdgeInsets.symmetric(horizontal: 14, vertical: 8), shape: RoundedRectangleBorder(
decoration: new BoxDecoration( borderRadius: BorderRadius.circular(10),
color: Colors.grey.shade100, side: isSelected ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0),
shape: BoxShape.rectangle, ),
borderRadius: BorderRadius.circular(8), child: Padding(
border: Border.fromBorderSide(BorderSide( padding: const EdgeInsets.all(12.0),
color: isSelected ? Color(0xff20BC11) : Colors.grey.shade300, child: Row(
width: 0.8, children: [
)), Container(
), width: 24,
width: cardWidth, height: 24,
child: Image.asset( decoration: containerColorRadiusBorderWidth(isSelected ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
getPaymentOptionImage(paymentOption),
fit: BoxFit.cover,
),
),
if (isSelected)
Positioned(
right: 1,
child: Icon(
Icons.check_circle,
color: Color(0xff20BC11),
size: 30,
), ),
), mWidth(12),
], Container(
height: 70.0,
width: 70.0,
child: Image.asset(getPaymentOptionImage(paymentOption)),
),
mFlex(1),
if (isSelected)
Container(
decoration: containerRadius(CustomColors.green, 200),
padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12),
child: Text(
TranslationBase.of(context).paymentSelected,
style: TextStyle(
color: Colors.white,
fontSize: 11,
),
),
),
],
),
),
), ),
// Container(
// margin: EdgeInsets.symmetric(horizontal: 2, vertical: 0),
// child: Stack(
// children: [
// Container(
// padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8),
// margin: EdgeInsets.symmetric(horizontal: 14, vertical: 8),
// decoration: new BoxDecoration(
// color: Colors.grey.shade100,
// shape: BoxShape.rectangle,
// borderRadius: BorderRadius.circular(8),
// border: Border.fromBorderSide(BorderSide(
// color: isSelected ? Color(0xff20BC11) : Colors.grey.shade300,
// width: 0.8,
// )),
// ),
// width: cardWidth,
// child: Image.asset(
// getPaymentOptionImage(paymentOption),
// fit: BoxFit.cover,
// ),
// ),
// if (isSelected)
// Positioned(
// right: 1,
// child: Icon(
// Icons.check_circle,
// color: Color(0xff20BC11),
// size: 30,
// ),
// ),
// ],
// ),
// ),
), ),
); );
} }
String getPaymentOptionImage(PaymentOption paymentOption) { String getPaymentOptionImage(PaymentOption paymentOption) {
String assetFile = "assets/images/pharmacy_module/payment/"; String assetFile = "assets/images/new/payment/";
switch (paymentOption.index) { switch (paymentOption.index) {
case 0: case 0:
return "${assetFile}mada.png"; return "${assetFile}Mada.png";
break; break;
case 1: case 1:
return "${assetFile}sadad.png"; return "${assetFile}sadad.png";
@ -190,10 +221,13 @@ class PaymentMethodCard extends StatelessWidget {
return "${assetFile}visa.png"; return "${assetFile}visa.png";
break; break;
case 3: case 3:
return "${assetFile}mastercard.png"; return "${assetFile}Mastercard.png";
break; break;
case 4: case 4:
return "${assetFile}installment.png"; return "${assetFile}installments.png";
break;
case 5:
return "${assetFile}Apple_Pay.png";
break; break;
default: default:
return ""; return "";

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/footor/quantity_box.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/footor/quantity_box.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -10,8 +11,6 @@ import 'package:hexcolor/hexcolor.dart';
import '../../../../../locator.dart'; import '../../../../../locator.dart';
import '../../../../../routes.dart'; import '../../../../../routes.dart';
import '../../cart-page/cart-order-page.dart';
import '../product-detail.dart';
class FooterWidget extends StatefulWidget { class FooterWidget extends StatefulWidget {
final bool isAvailable; final bool isAvailable;
@ -26,13 +25,8 @@ class FooterWidget extends StatefulWidget {
int quantity; int quantity;
bool isOverQuantity; bool isOverQuantity;
FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, this.quantityLimit, this.item,
this.quantityLimit, this.item, {this.quantity, this.isOverQuantity = false, this.addToCartFunction, this.addToShoppingCartFunction, this.model});
{this.quantity,
this.isOverQuantity = false,
this.addToCartFunction,
this.addToShoppingCartFunction,
this.model});
@override @override
_FooterWidgetState createState() => _FooterWidgetState(); _FooterWidgetState createState() => _FooterWidgetState();
@ -41,8 +35,7 @@ class FooterWidget extends StatefulWidget {
class _FooterWidgetState extends State<FooterWidget> { class _FooterWidgetState extends State<FooterWidget> {
double quantityUI = 80; double quantityUI = 80;
bool showUI = false; bool showUI = false;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -77,8 +70,7 @@ class _FooterWidgetState extends State<FooterWidget> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
"Quantity", "Quantity",
style: TextStyle( style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
fontSize: 15, fontWeight: FontWeight.bold),
), ),
), ),
InkWell( InkWell(
@ -101,11 +93,7 @@ class _FooterWidgetState extends State<FooterWidget> {
SizedBox( SizedBox(
width: 5, width: 5,
), ),
for (int i = 1; i <= 10; i++) for (int i = 1; i <= 10; i++) QuantityBox(label: i, onTapFunc: onChangeValue, isSelected: widget.quantity == i),
QuantityBox(
label: i,
onTapFunc: onChangeValue,
isSelected: widget.quantity == i),
Container( Container(
width: 100, width: 100,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -113,16 +101,14 @@ class _FooterWidgetState extends State<FooterWidget> {
color: Colors.white, color: Colors.white,
), ),
child: TextField( child: TextField(
decoration: InputDecoration( decoration: InputDecoration(labelText: ' Quantity # '),
labelText: ' Quantity # '),
onChanged: (text) { onChanged: (text) {
if (int.tryParse(text) == null) { if (int.tryParse(text) == null) {
text = ''; text = '';
} else { } else {
setState(() { setState(() {
widget.quantity = int.parse(text); widget.quantity = int.parse(text);
if (widget.quantity >= if (widget.quantity >= widget.quantityLimit) {
widget.quantityLimit) {
widget.isOverQuantity = true; widget.isOverQuantity = true;
} else { } else {
widget.isOverQuantity = false; widget.isOverQuantity = false;
@ -187,20 +173,14 @@ class _FooterWidgetState extends State<FooterWidget> {
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).addToCart.toUpperCase(), label: TranslationBase.of(context).addToCart.toUpperCase(),
disabled: !widget.isAvailable && widget.quantity == 0 || disabled: (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx,
widget.quantity > widget.quantityLimit ||
widget.item.rxMessage != null,
disableColor: Color(0xFF4CAF50),
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
WELCOME_LOGIN, WELCOME_LOGIN,
); );
} else } else
await widget.addToCartFunction( await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
quantity: widget.quantity,
itemID: widget.item.id,
model: widget.model);
}, },
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderColor: Color(0xFF4CAF50), borderColor: Color(0xFF4CAF50),
@ -215,14 +195,9 @@ class _FooterWidgetState extends State<FooterWidget> {
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).buyNow.toUpperCase(), label: TranslationBase.of(context).buyNow.toUpperCase(),
disabled: !widget.isAvailable && widget.quantity > 0 || disabled: (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx,
widget.quantity > widget.quantityLimit ||
widget.item.rxMessage != null,
onTap: () async { onTap: () async {
await widget.addToShoppingCartFunction( await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
quantity: widget.quantity,
itemID: widget.item.id,
model: widget.model);
Navigator.push( Navigator.push(
context, context,
FadePage(page: CartOrderPage()), FadePage(page: CartOrderPage()),
@ -232,11 +207,7 @@ class _FooterWidgetState extends State<FooterWidget> {
borderColor: Colors.grey[800], borderColor: Colors.grey[800],
borderRadius: 3, borderRadius: 3,
disableColor: Colors.grey[700], disableColor: Colors.grey[700],
color: !widget.isAvailable && widget.quantity > 0 || color: !widget.isAvailable && widget.quantity > 0 || widget.quantity > widget.quantityLimit || widget.item.rxMessage != null ? Colors.grey : Colors.grey[800],
widget.quantity > widget.quantityLimit ||
widget.item.rxMessage != null
? Colors.grey
: Colors.grey[800],
), ),
), ),
], ],

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -12,7 +13,6 @@ import 'package:provider/provider.dart';
import '../../../../../locator.dart'; import '../../../../../locator.dart';
import '../../../compare-list.dart'; import '../../../compare-list.dart';
import '../../cart-page/cart-order-page.dart';
import 'icon_with_bg.dart'; import 'icon_with_bg.dart';
class ProductAppBar extends StatelessWidget with PreferredSizeWidget { class ProductAppBar extends StatelessWidget with PreferredSizeWidget {

@ -5,8 +5,6 @@ import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_h
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.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/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -27,30 +25,21 @@ class PrescriptionsWidget extends StatelessWidget {
isLocalLoader: true, isLocalLoader: true,
baseViewModel: model, baseViewModel: model,
child: Container( child: Container(
height: model.prescriptionsList.length > 0
? MediaQuery.of(context).size.height * 0.28
: 0,
child: Column( child: Column(
children: [ children: [
ViewAllHomeWidget( ViewAllHomeWidget(TranslationBase.of(context).myPrescription, HomePrescriptionsPage()),
TranslationBase.of(context).myPrescription,
HomePrescriptionsPage()),
Container( Container(
padding: EdgeInsets.symmetric( margin: EdgeInsets.only(right: 10.0, left: 10.0),
horizontal: 18.0, vertical: 14.0), height: MediaQuery.of(context).size.height * 0.18,
margin: EdgeInsets.only(left: 10),
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model.prescriptionsList.length, itemCount: model.prescriptionsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
height: MediaQuery.of(context).size.height * 0.3, padding: EdgeInsets.only(left: 8.0, right: 8.0),
padding: EdgeInsets.only( margin: EdgeInsets.only(right: 5.0, left: 5.0),
bottom: 5.0, left: 5.0, right: 8.0),
margin: EdgeInsets.only(right: 10.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.grey, color: Colors.grey,
@ -59,167 +48,130 @@ class PrescriptionsWidget extends StatelessWidget {
), ),
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(10.0)), borderRadius: BorderRadius.circular(10.0)),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, Row(
children: <Widget>[ children: <Widget>[
Row( Column(children: [
children: <Widget>[ Container(
Column(children: [ padding: EdgeInsets.only(
Container( top: 10.0,
padding: EdgeInsets.only( left: 10.0,
top: 10.0, right: 10.0,
left: 10.0, bottom: 15.0,
right: 10.0, ),
bottom: 15.0, child: CircleAvatar(
), radius: 30,
child: CircleAvatar( backgroundColor: Colors.transparent,
radius: 30, child: Image.network(
backgroundColor: model.prescriptionsList[index].doctorImageURL,
Colors.transparent, width: 60,
child: Image.network( height: 60,
model.prescriptionsList[index]
.doctorImageURL,
width: 60,
height: 60,
),
),
), ),
]),
Column(
children: [
Container(
margin:
EdgeInsets.only(left: 1),
padding: EdgeInsets.only(
left: 15.0, right: 15.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
style: BorderStyle.solid,
width: 4.0,
),
color: Colors.green,
borderRadius:
BorderRadius.circular(
30.0)),
child: Text(
model.languageID == "ar"
? model
.prescriptionsList[
index]
.isInOutPatientDescriptionN
.toString()
: model
.prescriptionsList[
index]
.isInOutPatientDescription
.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 15.0,
),
)),
Row(children: <Widget>[
Image.asset(
'assets/images/Icon-awesome-calendar.png',
width: 30,
height: 30,
),
Text(
DateUtil.convertStringToDate(
model
.prescriptionsList[
index]
.appointmentDate
.toString())
.toString()
.substring(0, 10),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
),
)
]),
],
), ),
], ),
), ]),
Row( Column(
crossAxisAlignment: children: [
CrossAxisAlignment.start,
children: <Widget>[
Container( Container(
margin: EdgeInsets.only(left: 5), margin: EdgeInsets.only(left: 1),
child: Row(children: <Widget>[ padding: EdgeInsets.only(left: 15.0, right: 15.0),
Text( decoration: BoxDecoration(
model.prescriptionsList[index] border: Border.all(
.doctorTitle color: Colors.green,
.toString(), style: BorderStyle.solid,
style: TextStyle( width: 4.0,
color: Colors.black, ),
fontSize: 15.0, color: Colors.green,
fontWeight: FontWeight.bold, borderRadius: BorderRadius.circular(30.0)),
), child: Text(
), model.languageID == "ar"
Text( ? model.prescriptionsList[index].isInOutPatientDescriptionN.toString()
model.prescriptionsList[index] : model.prescriptionsList[index].isInOutPatientDescription.toString(),
.doctorName
.toString(),
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.white,
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), )),
]), Row(children: <Widget>[
), Image.asset(
], 'assets/images/Icon-awesome-calendar.png',
), width: 30,
Row( height: 30,
crossAxisAlignment: ),
CrossAxisAlignment.start, Text(
children: <Widget>[ DateUtil.convertStringToDate(model.prescriptionsList[index].appointmentDate.toString()).toString().substring(0, 10),
Container(
margin: EdgeInsets.only(left: 5),
child: Text(
model.prescriptionsList[index]
.clinicDescription
.toString(),
style: TextStyle( style: TextStyle(
color: Colors.green, color: Colors.black,
fontSize: 15.0, fontSize: 15.0,
// fontWeight: FontWeight.bold,
), ),
)
]),
],
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Row(children: <Widget>[
Text(
model.prescriptionsList[index].doctorTitle.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), ),
], Text(
model.prescriptionsList[index].doctorName.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
]),
), ),
Row( ],
crossAxisAlignment: ),
CrossAxisAlignment.start, Row(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Container( children: <Widget>[
margin: EdgeInsets.only(left: 5), Container(
child: Align( margin: EdgeInsets.only(left: 5),
alignment: Alignment.topLeft, child: Text(
child: RatingBar.readOnly( model.prescriptionsList[index].clinicDescription.toString(),
initialRating: model style: TextStyle(
.prescriptionsList[index] color: Colors.green,
.actualDoctorRate fontSize: 15.0,
.toDouble(), // fontWeight: FontWeight.bold,
),
),
),
],
),
Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: model.prescriptionsList[index].actualDoctorRate.toDouble(),
// initialRating: productRate, // initialRating: productRate,
size: 15.0, size: 15.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500], emptyColor: Colors.grey[500],
isHalfAllowed: true, isHalfAllowed: true,
halfFilledIcon: Icons.star_half, halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, filledIcon: Icons.star,
emptyIcon: Icons.star, emptyIcon: Icons.star,
), ),
), ),
) )
]), ]),
]), ]),
); );
}), }),
), ),

@ -1,5 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
extension WithContainer on DefaultButton {
Widget get insideContainer => Container(color: Colors.white, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: this);
}
class DefaultButton extends StatelessWidget { class DefaultButton extends StatelessWidget {
final String text; final String text;
final VoidCallback onPress; final VoidCallback onPress;

@ -1,4 +1,3 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart';
@ -7,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dar
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_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.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/dialogs/confirm_send_email_dialog.dart';
@ -14,9 +14,7 @@ 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';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import '../../text.dart';
import 'FlowChartPage.dart'; import 'FlowChartPage.dart';
class LabResultWidget extends StatelessWidget { class LabResultWidget extends StatelessWidget {
@ -81,6 +79,14 @@ class LabResultWidget extends StatelessWidget {
), ),
) )
: Container(), : Container(),
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Divider(
height: 1,
color: Color(0xff2E303A),
thickness: 1,
),
),
], ],
), ),
); );
@ -152,10 +158,10 @@ class LabResultWidget extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Utils.tableColumnTitle(TranslationBase.of(context).description), Utils.tableColumnTitle(TranslationBase.of(context).description, showDivider: false),
Utils.tableColumnTitle(TranslationBase.of(context).value), Utils.tableColumnTitle(TranslationBase.of(context).value, showDivider: false),
Utils.tableColumnTitle(TranslationBase.of(context).range), Utils.tableColumnTitle(TranslationBase.of(context).range, showDivider: false),
Utils.tableColumnTitle(""), Utils.tableColumnTitle("", showDivider: false),
], ],
), ),
); );

@ -13,8 +13,9 @@ class RadioSelectionDialog extends StatefulWidget {
final Function(int) onValueSelected; final Function(int) onValueSelected;
final List<RadioSelectionDialogModel> listData; final List<RadioSelectionDialogModel> listData;
final int selectedIndex; final int selectedIndex;
final bool isScrollable;
const RadioSelectionDialog({Key key, this.onValueSelected, this.listData, this.selectedIndex}) : super(key: key); const RadioSelectionDialog({Key key, this.onValueSelected, this.listData, this.selectedIndex, this.isScrollable = false}) : super(key: key);
@override @override
State createState() => new RadioSelectionDialogState(); State createState() => new RadioSelectionDialogState();
@ -68,36 +69,41 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
TranslationBase.of(context).pleaseSelectFromBelowOptions, TranslationBase.of(context).pleaseSelectFromBelowOptions,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
ListView.separated( SizedBox(height: widget.isScrollable ? 12 : 0),
physics: NeverScrollableScrollPhysics(), SizedBox(
shrinkWrap: true, height: widget.isScrollable ? MediaQuery.of(context).size.height * .4 : null,
padding: EdgeInsets.only(bottom: 42, top: 10), child: ListView.separated(
itemBuilder: (context, index) { physics: widget.isScrollable ? BouncingScrollPhysics() : NeverScrollableScrollPhysics(),
return Row( shrinkWrap: !widget.isScrollable,
children: [ padding: EdgeInsets.only(bottom: widget.isScrollable ? 21 : 42, top: 10),
SizedBox( itemBuilder: (context, index) {
width: 22, return Row(
height: 22, children: [
child: Radio( SizedBox(
value: widget.listData[index].value, width: 22,
groupValue: selectedIndex, height: 22,
onChanged: (value) { child: Radio(
setState(() { value: widget.listData[index].value,
selectedIndex = value; groupValue: selectedIndex,
}); onChanged: (value) {
}, setState(() {
selectedIndex = value;
});
},
),
), ),
), SizedBox(width: 8),
SizedBox(width: 8), Text(
Text( widget.listData[index].title,
widget.listData[index].title, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.56),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.56), ),
), ],
], );
); },
}, separatorBuilder: (context, index) => SizedBox(height: 10),
separatorBuilder: (context, index) => SizedBox(height: 10), itemCount: widget.listData.length),
itemCount: widget.listData.length), ),
SizedBox(height: widget.isScrollable ? 12 : 0),
Row( Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [

@ -1,5 +1,3 @@
import 'dart:io';
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/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
@ -36,7 +34,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:in_app_review/in_app_review.dart'; import 'package:in_app_review/in_app_review.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../locator.dart'; import '../../locator.dart';

@ -225,34 +225,6 @@ class SMSOTP {
}); });
} }
// todo 'sikander' remove useless code
// static void showLoadingDialog(BuildContext context, bool _loading) async {
// _context = context;
// //setSignature();
// if (_loading == false) {
// Navigator.of(context).pop();
// return;
// }
// _loading = true;
// await showDialog(
// context: _context,
// barrierDismissible: false,
// builder: (BuildContext context) {
// return SimpleDialog(
// elevation: 0.0,
// backgroundColor: Colors.transparent,
// children: <Widget>[
// Center(
// child: CircularProgressIndicator(
// valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
// ),
// )
// ],
// );
// });
// }
static void hideSMSBox(context) { static void hideSMSBox(context) {
Navigator.pop(context); Navigator.pop(context);
} }

@ -1,6 +1,6 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.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';
@ -26,27 +26,27 @@ class productTile extends StatelessWidget {
final dynamic productID; final dynamic productID;
final Function onDelete; final Function onDelete;
final dynamic approvedTotalReviews; final dynamic approvedTotalReviews;
// final VoidCallback deleteWishlistItems;
productTile( // final VoidCallback deleteWishlistItems;
{this.productName,
this.productPrice,
this.productRate,
this.productReviews,
this.qyt,
this.totalPrice,
this.isOrderDetails = false,
this.productImage,
this.showLine = true,
this.img,
this.imgs,
this.status,
this.product,
this.productID,
this.onDelete,
this.approvedTotalReviews,
}); productTile({
this.productName,
this.productPrice,
this.productRate,
this.productReviews,
this.qyt,
this.totalPrice,
this.isOrderDetails = false,
this.productImage,
this.showLine = true,
this.img,
this.imgs,
this.status,
this.product,
this.productID,
this.onDelete,
this.approvedTotalReviews,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -91,10 +91,7 @@ class productTile extends StatelessWidget {
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: productName, text: productName,
style: TextStyle( style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
), ),
), ),
), ),
@ -106,19 +103,16 @@ class productTile extends StatelessWidget {
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: 'SAR $productPrice', text: 'SAR $productPrice',
style: TextStyle( style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
), ),
), ),
), ),
), ),
this.isOrderDetails == false this.isOrderDetails == false
? Row( ? Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
@ -134,14 +128,12 @@ class productTile extends StatelessWidget {
), ),
), ),
), ),
Text( '$approvedTotalReviews', Text(
style: TextStyle( '$approvedTotalReviews',
fontWeight: FontWeight.bold, style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
color: Colors.grey, ),
fontSize: 13), ],
), )
],
)
: Container(), : Container(),
], ],
), ),
@ -164,9 +156,11 @@ class productTile extends StatelessWidget {
height: 50, height: 50,
), ),
IconButton( IconButton(
icon: Icon(Icons.shopping_cart, icon: Icon(
Icons.shopping_cart,
size: 18, size: 18,
color: Colors.blue,), color: Colors.blue,
),
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, productID); await addToCartFunction(1, productID);
@ -192,13 +186,8 @@ class productTile extends StatelessWidget {
margin: EdgeInsets.only(bottom: 5.0), margin: EdgeInsets.only(bottom: 5.0),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: TranslationBase.of(context).quantity + text: TranslationBase.of(context).quantity + "" + '$qyt',
"" + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
'$qyt',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.grey,
fontSize: 13),
), ),
), ),
), ),
@ -224,10 +213,7 @@ class productTile extends StatelessWidget {
RichText( RichText(
text: TextSpan( text: TextSpan(
text: ' $totalPrice SAR', text: ' $totalPrice SAR',
style: TextStyle( style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 15),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 15),
), ),
), ),
], ],
@ -268,30 +254,19 @@ class productTile extends StatelessWidget {
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: '($productReviews reviews)', text: '($productReviews reviews)',
style: TextStyle( style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
fontWeight: FontWeight.bold,
color: Colors.grey,
fontSize: 13),
), ),
), ),
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(context, FadePage(page: ProductReviewPage(product)));
context, FadePage(page: ProductReviewPage(product)));
}, },
child: Container( child: Container(
padding: padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
height: 30.0, height: 30.0,
decoration: BoxDecoration( decoration: BoxDecoration(border: Border.all(color: Colors.orange, style: BorderStyle.solid, width: 1.0), color: Colors.transparent, borderRadius: BorderRadius.circular(5.0)),
border: Border.all(
color: Colors.orange,
style: BorderStyle.solid,
width: 1.0),
color: Colors.transparent,
borderRadius: BorderRadius.circular(5.0)),
child: Text( child: Text(
TranslationBase.of(context).writeReview, TranslationBase.of(context).writeReview,
style: TextStyle( style: TextStyle(

Loading…
Cancel
Save