diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c70c68ba..dd7c8123 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -236,14 +236,16 @@ const Map localizedValues = { "delete-view": {"en": "Delete", "ar": "حذف"}, // "my-family": {"en": "MY FAMILY", "ar": "عائلتي"}, "approvals": {"en": "Approvals", "ar": "موافقات التأمين"}, - "approvalNo": {"en": "Approval No.: ", "ar": "رقم الموافقة: "}, - "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, - "receiptOn": {"en": "Receipt on: ", "ar": "تاريخ الفاتورة: "}, - "expiryDate": {"en": "Expiry Date: ", "ar": "تاريخ الانتهاء: "}, + "approvalNo": {"en": "Approval No:", "ar": "رقم الموافقة: "}, + "companyName": {"en": "Company Name:", "ar": "اسم الشركة: "}, + "receiptOn": {"en": "Receipt on:", "ar": "تاريخ الفاتورة: "}, + "expiryDate": {"en": "Expiry Date:", "ar": "تاريخ الانتهاء: "}, + "expiryOn": {"en": "Expiry on:", "ar": "تاريخ الانتهاء: "}, "procedureName": {"en": "Procedure Name:", "ar": "اسم الاجراء:"}, + "procedure": {"en": "Procedure", "ar": "اسم الاجراء:"}, "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, - "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, + "unusedCount": {"en": "Unused Count:", "ar": "غير مستخدم: "}, "totalApproval": {"en": "Total approval unused", "ar": "اجمالي الموافقات الغير مستخدمة"}, "category": {"en": "Category: ", "ar": "الفئة"}, "expirationDate": {"en": "Expiration Date: ", "ar": "تاريخ الانتهاء"}, @@ -487,7 +489,7 @@ const Map localizedValues = { "products": {"en": "Products", "ar": "المنتجات"}, "reviews": {"en": "Reviews", "ar": "التقيمات"}, "brands": {"en": "Brands", "ar": "العلامات التجارية"}, - "productDetails": {"en": "Product Details", "ar": "تفاصيل المنتج"}, + "productDetails": {"en": "Product Details", "ar": "تفاصيل المنتج"}, // "medicationRefill": {"en": "Medication Refill", "ar": "تعبئة الأدوية"}, "pillReminder": {"en": "Pill Reminder", "ar": "تذكير الأدويه"}, "shippingAddresses": {"en": "Shipping Addresses", "ar": "عناوين الشحن"}, @@ -613,10 +615,7 @@ const Map localizedValues = { "select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, "i-am": {"en": "I am", "ar": "أنا"}, "years-old": {"en": "years old", "ar": "سنة"}, - "drag-point": { - "en": "Drag point to change your age", - "ar": "اسحب لتغيير عمرك" - }, + "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "refine": {"en": "Refine", "ar": "refine"}, "reset": {"en": "Reset", "ar": "اعادة تعيين"}, "apply": {"en": "Apply", "ar": "تطبيق"}, @@ -626,10 +625,7 @@ const Map localizedValues = { "myAccount": {"en": "My Account", "ar": "حسابي"}, "cart": {"en": "Cart", "ar": "التسوق"}, "Alhabibapp": {"en": "Al habib app", "ar": "تطبيق الحبيب"}, - "searchProductHere": { - "en": "Search Product here", - "ar": "البحث عن منتج" - }, + "searchProductHere": {"en": "Search Product here", "ar": "البحث عن منتج"}, "HHCNotAuthMsg": { "en": "This service provides a set of home health care services, continuous and comprehensive follow-up in their places of residence for those who cannot access health facilities, such as (laboratory analyzes - radiology - vaccinations - physical therapy), etc.", @@ -1482,26 +1478,29 @@ const Map localizedValues = { "online-clinics": {"en": "Online Clinics: ", "ar": "​العيادات المفتوحة: "}, "offline-clinics": {"en": "Offline Clinics: ", "ar": "العيادات المغلقة: "}, "clinic-schedule": {"en": "Clinic Schedule", "ar": "جدول العيادة"}, - "discount": { "en": "Discount:", "ar": "الخصم:" }, - "total-VAT": { "en": "VAT", "ar": "القيمة المضافة" }, - "paid": { "en": "Paid", "ar": "المدفوع" }, - "dental-insurance": { "en": "Insurance", "ar": "التأمين" }, - "drivethru-appo": { "en": "Drive Thru Appointment", "ar": "موعد من داخل السيارة" }, - "upcoming-QR-NFC": { "en": "Use the NFC or QR Code to Check-In", "ar": "استخدم NFC أو رمزQR لتسجيل الوصول" }, - "ovulation-desc": { "en": "Calculates Ovulation Period", "ar": "حساب افضل فترة للحمل بناءاً على تاريخ اخر دورة شهرية" }, - "cycle-label": { "en": "Average Cycle Length (usually 28 days):", "ar": "متوسط الدورة الشهرية 28 يوم : " }, - "luteal-label": { "en": "Average Luteal Phase Length (usually 14 days):", "ar": "متوسط الأيام ما بعد الاباضة عادة 14 يوما : " }, - "pregnancy-title": { "en": "Delivery Due Date", "ar": "تاريخ الولادة" }, - "pregnancy-desc": { "en": "Congratulations, you are pregnant! Now when will the new baby arrive? To estimate the due date, enter the date when the last menstrual period began (the first day), then click calculate.", "ar": "مبروك, أنت حامل! الآن متى سيصل الطفل؟ لتقدير موعد الولادة, ادخل تاريخ بداية آخر دورة شهرية (اليوم الأول), ثم اضغط على الحساب" }, - "pregnancy-date-label": { "en": "What was the date of the first day of the last period?", "ar": "ما هو تاريخ أول يوم من أخر دورة شهرية ؟" }, - "ovulation-period": { "en": "The next ovulation period is estimated to be: ", "ar": "تقدر فترة الاباضة القادمة " }, - "from": { "en": "From: ", "ar": "من:" }, - "to": { "en": "To: ", "ar": "الى:" }, - "conceive": { "en": "You have conceived on: ", "ar": " تاريخ بداية الحمل" }, - "firstTri": { "en": "First Trimester Ends (12 weeks):", "ar": "تاريخ انتهاء الثلث الأول 12 اسبوع: " }, - "secondTri": { "en": "Second Trimester Ends (27 weeks):", "ar": "تاريخ انتهاء الثلث الثاني 27 اسبوع: " }, - "thirdTri": { "en": "Third Trimester, Estimated Due Date (40 weeks):", "ar": "تاريخ احتمال الولادة 40 اسبوع:" }, - "seeDoctorsList": { "en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء" }, + "discount": {"en": "Discount:", "ar": "الخصم:"}, + "total-VAT": {"en": "VAT", "ar": "القيمة المضافة"}, + "paid": {"en": "Paid", "ar": "المدفوع"}, + "dental-insurance": {"en": "Insurance", "ar": "التأمين"}, + "drivethru-appo": {"en": "Drive Thru Appointment", "ar": "موعد من داخل السيارة"}, + "upcoming-QR-NFC": {"en": "Use the NFC or QR Code to Check-In", "ar": "استخدم NFC أو رمزQR لتسجيل الوصول"}, + "ovulation-desc": {"en": "Calculates Ovulation Period", "ar": "حساب افضل فترة للحمل بناءاً على تاريخ اخر دورة شهرية"}, + "cycle-label": {"en": "Average Cycle Length (usually 28 days):", "ar": "متوسط الدورة الشهرية 28 يوم : "}, + "luteal-label": {"en": "Average Luteal Phase Length (usually 14 days):", "ar": "متوسط الأيام ما بعد الاباضة عادة 14 يوما : "}, + "pregnancy-title": {"en": "Delivery Due Date", "ar": "تاريخ الولادة"}, + "pregnancy-desc": { + "en": "Congratulations, you are pregnant! Now when will the new baby arrive? To estimate the due date, enter the date when the last menstrual period began (the first day), then click calculate.", + "ar": "مبروك, أنت حامل! الآن متى سيصل الطفل؟ لتقدير موعد الولادة, ادخل تاريخ بداية آخر دورة شهرية (اليوم الأول), ثم اضغط على الحساب" + }, + "pregnancy-date-label": {"en": "What was the date of the first day of the last period?", "ar": "ما هو تاريخ أول يوم من أخر دورة شهرية ؟"}, + "ovulation-period": {"en": "The next ovulation period is estimated to be: ", "ar": "تقدر فترة الاباضة القادمة "}, + "from": {"en": "From: ", "ar": "من:"}, + "to": {"en": "To: ", "ar": "الى:"}, + "conceive": {"en": "You have conceived on: ", "ar": " تاريخ بداية الحمل"}, + "firstTri": {"en": "First Trimester Ends (12 weeks):", "ar": "تاريخ انتهاء الثلث الأول 12 اسبوع: "}, + "secondTri": {"en": "Second Trimester Ends (27 weeks):", "ar": "تاريخ انتهاء الثلث الثاني 27 اسبوع: "}, + "thirdTri": {"en": "Third Trimester, Estimated Due Date (40 weeks):", "ar": "تاريخ احتمال الولادة 40 اسبوع:"}, + "seeDoctorsList": {"en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء"}, "covidQuestionnaire": { "en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:" }, "covidBookAppo": { "en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: " }, "emptySchedule": { "en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب" } diff --git a/lib/pages/insurance/insurance_approval_detail_screen.dart b/lib/pages/insurance/insurance_approval_detail_screen.dart new file mode 100644 index 00000000..d00f22db --- /dev/null +++ b/lib/pages/insurance/insurance_approval_detail_screen.dart @@ -0,0 +1,124 @@ +import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class InsuranceApprovalDetail extends StatelessWidget { + final InsuranceApprovalModel insuranceApprovalModel; + InsuranceApprovalDetail({Key key, this.insuranceApprovalModel}) : super(key: key); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return AppScaffold( + isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + appBarTitle: TranslationBase.of(context).insuranceApproval, + description: TranslationBase.of(context).infoApprovals, + infoList: TranslationBase.of(context).infoApprovalPoints, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.all(21), + child: Container( + padding: EdgeInsets.fromLTRB(16, 12, 16, 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + insuranceApprovalModel.approvalStatusDescption, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: insuranceApprovalModel.status == 9 ? Color(0xff359846) : Color(0xffD02127), letterSpacing: -0.4, height: 18 / 10), + ), + Text( + insuranceApprovalModel.doctorName, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.64, + ), + ), + SizedBox(height: 6), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LargeAvatar( + name: insuranceApprovalModel.doctorName, + url: insuranceApprovalModel.doctorImageURL, + width: 48, + height: 48, + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + myRichText(TranslationBase.of(context).clinic + ":", insuranceApprovalModel?.clinicName.toLowerCase().capitalizeFirstofEach ?? "", projectViewModel.isArabic), + myRichText(TranslationBase.of(context).approvalNo, insuranceApprovalModel?.approvalNo.toString() ?? "", projectViewModel.isArabic), + myRichText(TranslationBase.of(context).unusedCount, insuranceApprovalModel?.unUsedCount.toString() ?? "", projectViewModel.isArabic), + myRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic), + SizedBox(height: 6), + myRichText(TranslationBase.of(context).receiptOn, + DateUtil.formatDateToDate(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn), projectViewModel.isArabic) ?? "", projectViewModel.isArabic), + myRichText(TranslationBase.of(context).expiryOn, + DateUtil.formatDateToDate(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate), projectViewModel.isArabic) ?? "", projectViewModel.isArabic), + ], + ), + ), + ], + ), + SizedBox(height: 21), + Table(columnWidths: { + 0: FlexColumnWidth(1.8), + 1: FlexColumnWidth(1), + 2: FlexColumnWidth(1), + }, children: fullData(context)) + ], + ), + ), + ), + ); + } + + List fullData(context) { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Utils.tableColumnTitle(TranslationBase.of(context).procedure), + Utils.tableColumnTitle(TranslationBase.of(context).status), + Utils.tableColumnTitle(TranslationBase.of(context).usageStatus) + ], + ), + ); + tableRow.add( + TableRow( + children: [ + Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.procedureName ?? '', isLast: true), + Utils.tableColumnValue(insuranceApprovalModel?.approvalStatusDescption ?? '', isLast: true), + Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.isInvoicedDesc.toString() ?? '', isLast: true), + ], + ), + ); + return tableRow; + } +} diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index a69b2c16..8c443113 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -1,14 +1,21 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import '../base/base_view.dart'; +import 'insurance_approval_detail_screen.dart'; class InsuranceApproval extends StatefulWidget { int appointmentNo; @@ -24,6 +31,7 @@ class _InsuranceApprovalState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); imagesInfo .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png')); imagesInfo @@ -31,275 +39,133 @@ class _InsuranceApprovalState extends State { return BaseView( onModelReady: widget.appointmentNo != null ? (model) => model.getInsuranceApproval(appointmentNo: widget.appointmentNo) : (model) => model.getInsuranceApproval(), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( - isShowAppBar: true, - showNewAppBar: true, - baseViewModel: model, - showNewAppBarTitle: true, - appBarTitle: TranslationBase.of(context).approvals, - description: TranslationBase.of(context).infoApprovals, - infoList: TranslationBase.of(context).infoApprovalPoints, - imagesInfo: imagesInfo, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: Column( - children: [ - Container( - width: double.infinity, - height: SizeConfig.screenHeight * 0.09, - color: Color(0xffEEEEEE), + isShowAppBar: true, + showNewAppBar: true, + baseViewModel: model, + showNewAppBarTitle: true, + appBarTitle: TranslationBase.of(context).insuranceApproval, + description: TranslationBase.of(context).infoApprovals, + infoList: TranslationBase.of(context).infoApprovalPoints, + imagesInfo: imagesInfo, + body: ListView.separated( + padding: EdgeInsets.all(21), + itemBuilder: (context, index) { + Color _patientStatusColor; + String _patientStatusString; + + if (model.insuranceApproval[index].isLiveCareAppointment) { + _patientStatusColor = Color(0xff2E303A); + _patientStatusString = TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach; + } else if (!model.insuranceApproval[index].isInOutPatient) { + _patientStatusColor = Color(0xffD02127); + _patientStatusString = TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach; + } else { + _patientStatusString = TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach; + _patientStatusColor = Color(0xffa9a089); + } + return InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InsuranceApprovalDetail(insuranceApprovalModel: model.insuranceApproval[index]))); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: _patientStatusColor), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Texts( - TranslationBase.of(context).totalApproval, - color: Color(0xff60688B), - fontSize: 19.0, - fontWeight: FontWeight.w600, + children: [ + SizedBox( + width: 16, + child: RotatedBox( + quarterTurns: 3, + child: Text( + _patientStatusString, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10), + ), + ), ), - if (model.insuranceApproval.length > 0) - Container( - width: 60, - height: 40, - decoration: BoxDecoration(color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(19.0)), - child: Center( - child: Texts( - model.insuranceApproval[0].unUsedCount.toString(), - color: Colors.white, - fontSize: 17.0, + Expanded( + child: Container( + padding: EdgeInsets.fromLTRB(12, 10, 12, 10), + decoration: BoxDecoration( + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10.0), + topRight: Radius.circular(10.0), ), - )) - ], - )), - ...List.generate(model.insuranceApproval.length, (index) { - return RoundedContainer( - backgroundColor: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Container( - //height: 120.0, + color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ - model.insuranceApproval[index].isLiveCareAppointment - ? sideBadge(TranslationBase.of(context).liveCare, 0xffA9A089) - : model.insuranceApproval[index].isInOutPatient - ? sideBadge(TranslationBase.of(context).outpatient, 0xff505a5d) - : sideBadge(TranslationBase.of(context).inPatient, 0xffb8372c), - Padding( - padding: EdgeInsets.symmetric(vertical: 10.0), - child: Texts( - model.insuranceApproval[index].clinicName, - fontSize: 20.0, - color: Color(0xff60686B), - fontWeight: FontWeight.w600, - ), + children: [ + Text( + model.insuranceApproval[index].approvalStatusDescption, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: model.insuranceApproval[index].status == 9 ? Color(0xff359846) : Color(0xffD02127), + letterSpacing: -0.4, + height: 18 / 10), ), - Texts( + Text( model.insuranceApproval[index].doctorName, - fontSize: 17.0, - ), - ], - ), - ), - children: [ - Padding( - padding: EdgeInsets.symmetric(vertical: 12.0, horizontal: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Texts( - TranslationBase.of(context).approvalNo, - fontSize: 18.0, - ), - Texts( - model.insuranceApproval[index].approvalNo.toString(), - fontSize: 18.0, - fontWeight: FontWeight.w600, - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).procedureStatus, - fontSize: 17.5, - ), - SizedBox( - width: 12, - ), - Texts( - model.insuranceApproval[index].approvalStatusDescption, - fontWeight: FontWeight.w600, - fontSize: 17.5, - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).unusedCount, - fontSize: 17.5, - ), - Texts( - model.insuranceApproval[index].unUsedCount.toString(), - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Texts( - TranslationBase.of(context).companyName + ": " + model.insuranceApproval[index].companyName.toString(), + style: TextStyle( + fontSize: 16, fontWeight: FontWeight.w600, - fontSize: 17.5, - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, + color: Color(0xff2E303A), + letterSpacing: -0.64, ), - Row( - children: [ - Texts( - TranslationBase.of(context).receiptOn, - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), - Texts( - model.insuranceApproval[index].receiptOn != null ? convertDateFormat(model.insuranceApproval[index].receiptOn) : "", - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).expiryDate, - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), - Texts( - convertDateFormat(model.insuranceApproval[index].expiryDate), - fontSize: 17.5, - fontWeight: FontWeight.w600, + ), + SizedBox(height: 6), + Row( + children: [ + LargeAvatar( + name: model.insuranceApproval[index].doctorName, + url: model.insuranceApproval[index].doctorImageURL, + width: 48, + height: 48, + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + myRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index]?.clinicName.toLowerCase().capitalizeFirstofEach ?? "", + projectViewModel.isArabic), + myRichText(TranslationBase.of(context).approvalNo, model.insuranceApproval[index]?.approvalNo.toString() ?? "", projectViewModel.isArabic), + ], ), - ], - ), - Divider( - color: Colors.black, - height: 55.0, - thickness: 1.2, - ), - IntrinsicHeight( - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of(context).procedureName), - Padding( - padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0), - child: Text( - model.insuranceApproval[index].apporvalDetails?.procedureName ?? '', - style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15.5), - ), - ), - ], - ), - ), - VerticalDivider( - width: 10.0, - thickness: 1.2, - color: Colors.black, - ), - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of(context).procedureStatus), - Padding( - padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0), - child: Text( - model.insuranceApproval[index].apporvalDetails?.status ?? '', - style: TextStyle(fontSize: 17.5, fontWeight: FontWeight.w600), - ), - ), - ], - ), - ), - VerticalDivider( - width: 2.3, - thickness: 1.2, - color: Colors.black, - ), - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of(context).usageStatus), - Padding( - padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0), - child: Text( - model.insuranceApproval[index].apporvalDetails?.isInvoicedDesc ?? '', - style: TextStyle(fontWeight: FontWeight.w600, fontSize: 17.5), - ), - ), - ], - ), - ), - ], ), - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - ], - ), + Container( + height: 48, + alignment: Alignment.bottomRight, + child: Icon( + Icons.visibility_sharp, + color: Color(0xff2E303A), + ), + ) + ], + ) + ], ), - ], + ), ), ], ), - ); - }), - ], - ), - ), - ), - ), + ), + ); + }, + separatorBuilder: (context, index) => SizedBox(height: 12), + itemCount: model.insuranceApproval.length)), ); } diff --git a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart index 30bfa13e..e451c317 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart @@ -1,13 +1,17 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/BottomButton.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PrescriptionsHistoryDetailsPage extends StatelessWidget { final PrescriptionsOrder prescriptionsOrder; @@ -16,138 +20,174 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPrescriptionReportEnh( - prescriptionsOrder: prescriptionsOrder), - builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).orderDetails, - baseViewModel: model, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.all(15.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - Container( - width: double.infinity, - decoration: BoxDecoration( - color: prescriptionsOrder.status == 3 ?Colors.green : prescriptionsOrder.status ==2 ? Colors.grey: Colors.red, - borderRadius: BorderRadius.circular(5)), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Texts(TranslationBase.of(context).orderStatus +' : ${prescriptionsOrder.descriptionN}',color: Colors.white,), - )), - SizedBox( - height: 15, - ), - Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 0.5), - outside: BorderSide(width: 0.5)), - children: [ - TableRow(children: [ - Container( - height: 50, - color: Colors.white, - child: Center( - child: Texts(TranslationBase.of(context).orderNo), - ), - ), - Container( - height: 50, - color: Colors.white, - child: Center( - child: Texts(TranslationBase.of(context).date), - ), - ), - ]), - TableRow(children: [ - Container( - height: 70, - color: Colors.white, - child: Center( - child: Texts('${prescriptionsOrder.iD}'), - ), - ), - Container( - height: 70, - color: Colors.white, - child: Center( - child: Texts('${prescriptionsOrder.createdOn.year}-${prescriptionsOrder.createdOn.day}-${prescriptionsOrder.createdOn.day} ${prescriptionsOrder.createdOn.hour}:${prescriptionsOrder.createdOn.minute}'), + onModelReady: (model) => model.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder), + builder: (_, model, widget) { + int status = prescriptionsOrder.status; + String _statusDisp = projectViewModel.isArabic ? prescriptionsOrder.descriptionN : prescriptionsOrder.description; + Color _color; + if (status == 1) { + //pending + _color = Color(0xffCC9B14); + } else if (status == 2) { + //processing + _color = Color(0xff2E303A); + } else if (status == 3) { + //completed + _color = Color(0xff359846); + } else if (status == 4) { + //cancel // Rejected + _color = Color(0xffD02127); + } + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).orderDetails, + baseViewModel: model, + showNewAppBar: true, + backgroundColor: Color(0xffF8F8F8), + showNewAppBarTitle: true, + body: Column( + children: [ + Expanded( + child: ListView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.all(21), + children: [ + Container( + decoration: BoxDecoration( + color: _color, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], ), - ]) - ], - ), - SizedBox( - height: 15, - ), - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => Container( - margin: EdgeInsets.all(8.0), - color: Colors.white, - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, + child: Container( + margin: EdgeInsets.only(left: 6), + padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10.0), + topRight: Radius.circular(10.0), ), ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(model.prescriptionReportEnhList[index] - .itemDescription), + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _statusDisp, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10), + ), + Text( + '${TranslationBase.of(context).orderNo}. ${prescriptionsOrder.iD}', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + ], + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + DateUtil.formatDateToDate(prescriptionsOrder.createdOn, projectViewModel.isArabic), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), + ), + Text( + DateUtil.formatDateToTime(prescriptionsOrder.createdOn), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), + ), + ], + ) ], ), - ), + SizedBox(height: 16), + ListView.separated( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) => Row( + children: [ + Container( + decoration: BoxDecoration( + border: Border.all(width: 1.0, color: Color(0xffEBEBEB)), + borderRadius: BorderRadius.all(Radius.circular(30.0)), + ), + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(30)), + child: Image.network( + model.prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 48, + height: 48, + ), + ), + ), + SizedBox(width: 14), + Expanded( + child: Text( + (model.prescriptionReportEnhList[index].itemDescription.isNotEmpty + ? model.prescriptionReportEnhList[index].itemDescription + : model.prescriptionReportEnhList[index].itemDescriptionN ?? '') + .toLowerCase() + .capitalizeFirstofEach, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), + ), + ) + ], + ), + separatorBuilder: (context, index) => SizedBox(height: 12), + itemCount: model.prescriptionReportEnhList.length) + ], ), - ], + ), ), - ), + ], ), - SizedBox(height: 120,) - ], - ), - ), - ), - bottomSheet: Container( - //padding: EdgeInsets.all(8.0), - // margin: EdgeInsets.all(8.0), - child: BottomButton( - label: TranslationBase.of(context).cancelOrder, - disabled: prescriptionsOrder.status != 1, - textColor: Colors.white, - onTap: (){ - - showCDialog(model,context); - //showAlertDialog(context); - }, + ), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).cancelOrder, + prescriptionsOrder.status != 1 + ? null + : () { + showCDialog(model, context); + }, + disabledColor: Color(0xff575757), + ), + ), + ], ), - ), - ), + ); + }, ); } - showCDialog(PrescriptionsViewModel model,context){ + showCDialog(PrescriptionsViewModel model, context) { ConfirmDialog( context: context, confirmMessage: "Are you sure ?", okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel, - okFunction: () { + okFunction: () { Navigator.of(context).pop(); model.updatePressOrder(presOrderID: prescriptionsOrder.iD).then((value) { Navigator.of(context).pop(); @@ -156,5 +196,4 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { cancelFunction: () => {}).showAlertDialog(context); // dialog.showAlertDialog(context); } - } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 12dddcfa..bebefd92 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -510,10 +510,14 @@ class TranslationBase { String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String get expiryOn => localizedValues['expiryOn'][locale.languageCode]; + String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get procedure => localizedValues['procedure'][locale.languageCode]; + String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; @@ -909,14 +913,10 @@ class TranslationBase { String get productDetails => localizedValues['productDetails'][locale.languageCode]; String get noReviewsAvailable => localizedValues['noReviewsAvailable'][locale.languageCode]; String get noLocationAvailable => localizedValues['noLocationAvailable'][locale.languageCode]; - String get myPrescriptions => - localizedValues['myPrescriptions'][locale.languageCode]; - String get medicationRefill => - localizedValues['medicationRefill'][locale.languageCode]; - String get pillReminder => - localizedValues['pillReminder'][locale.languageCode]; - String get shippingAddresses => - localizedValues['shippingAddresses'][locale.languageCode]; + String get myPrescriptions => localizedValues['myPrescriptions'][locale.languageCode]; + String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode]; + String get pillReminder => localizedValues['pillReminder'][locale.languageCode]; + String get shippingAddresses => localizedValues['shippingAddresses'][locale.languageCode]; String get reachUs => localizedValues['reachUs'][locale.languageCode]; String get ourLocations => localizedValues['ourLocations'][locale.languageCode]; @@ -1746,12 +1746,9 @@ class TranslationBase { String get addToCart => localizedValues['addToCart'][locale.languageCode]; String get addToWishlist => localizedValues['addToWishlist'][locale.languageCode]; String get buyNow => localizedValues['buyNow'][locale.languageCode]; - String get quantityShortcut => - localizedValues['quantityShortcut'][locale.languageCode]; - String get noData => - localizedValues['noData'][locale.languageCode]; - String get no_data => - localizedValues['no_data'][locale.languageCode]; + String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode]; + String get noData => localizedValues['noData'][locale.languageCode]; + String get no_data => localizedValues['no_data'][locale.languageCode]; String get year => localizedValues['Year'][locale.languageCode]; diff --git a/pubspec.yaml b/pubspec.yaml index 87393d82..ef6a1ecb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -71,7 +71,7 @@ dependencies: #GIF image flutter_gifimage: ^1.0.1 - flutter_webrtc: any +# flutter_webrtc: any # UI Reqs dotted_border: 1.0.5