Merge branch 'development_new_design_2.0' into haroon-new-design

# Conflicts:
#	lib/config/localized_values.dart
#	lib/pages/insurance/insurance_approval_screen.dart
#	lib/uitl/translations_delegate_base.dart
merge-update-with-lab-changes
haroon amjad 5 years ago
commit 728c22cc68

@ -236,11 +236,13 @@ const Map localizedValues = {
"delete-view": {"en": "Delete", "ar": "حذف"}, "delete-view": {"en": "Delete", "ar": "حذف"},
// "my-family": {"en": "MY FAMILY", "ar": "عائلتي"}, // "my-family": {"en": "MY FAMILY", "ar": "عائلتي"},
"approvals": {"en": "Approvals", "ar": "موافقات التأمين"}, "approvals": {"en": "Approvals", "ar": "موافقات التأمين"},
"approvalNo": {"en": "Approval No.: ", "ar": "رقم الموافقة: "}, "approvalNo": {"en": "Approval No:", "ar": "رقم الموافقة: "},
"companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, "companyName": {"en": "Company Name:", "ar": "اسم الشركة: "},
"receiptOn": {"en": "Receipt on:", "ar": "تاريخ الفاتورة: "}, "receiptOn": {"en": "Receipt on:", "ar": "تاريخ الفاتورة: "},
"expiryDate": {"en": "Expiry Date:", "ar": "تاريخ الانتهاء: "}, "expiryDate": {"en": "Expiry Date:", "ar": "تاريخ الانتهاء: "},
"expiryOn": {"en": "Expiry on:", "ar": "تاريخ الانتهاء: "},
"procedureName": {"en": "Procedure Name:", "ar": "اسم الاجراء:"}, "procedureName": {"en": "Procedure Name:", "ar": "اسم الاجراء:"},
"procedure": {"en": "Procedure", "ar": "اسم الاجراء:"},
"procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"},
"usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"},
"unusedCount": {"en": "Unused Count:", "ar": "غير مستخدم: "}, "unusedCount": {"en": "Unused Count:", "ar": "غير مستخدم: "},
@ -613,10 +615,7 @@ const Map localizedValues = {
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"i-am": {"en": "I am", "ar": "أنا"}, "i-am": {"en": "I am", "ar": "أنا"},
"years-old": {"en": "years old", "ar": "سنة"}, "years-old": {"en": "years old", "ar": "سنة"},
"drag-point": { "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"},
"en": "Drag point to change your age",
"ar": "اسحب لتغيير عمرك"
},
"refine": {"en": "Refine", "ar": "refine"}, "refine": {"en": "Refine", "ar": "refine"},
"reset": {"en": "Reset", "ar": "اعادة تعيين"}, "reset": {"en": "Reset", "ar": "اعادة تعيين"},
"apply": {"en": "Apply", "ar": "تطبيق"}, "apply": {"en": "Apply", "ar": "تطبيق"},
@ -626,10 +625,7 @@ const Map localizedValues = {
"myAccount": {"en": "My Account", "ar": "حسابي"}, "myAccount": {"en": "My Account", "ar": "حسابي"},
"cart": {"en": "Cart", "ar": "التسوق"}, "cart": {"en": "Cart", "ar": "التسوق"},
"Alhabibapp": {"en": "Al habib app", "ar": "تطبيق الحبيب"}, "Alhabibapp": {"en": "Al habib app", "ar": "تطبيق الحبيب"},
"searchProductHere": { "searchProductHere": {"en": "Search Product here", "ar": "البحث عن منتج"},
"en": "Search Product here",
"ar": "البحث عن منتج"
},
"HHCNotAuthMsg": { "HHCNotAuthMsg": {
"en": "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.", "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.",
@ -1492,7 +1488,10 @@ const Map localizedValues = {
"cycle-label": {"en": "Average Cycle Length (usually 28 days):", "ar": "متوسط الدورة الشهرية 28 يوم : "}, "cycle-label": {"en": "Average Cycle Length (usually 28 days):", "ar": "متوسط الدورة الشهرية 28 يوم : "},
"luteal-label": {"en": "Average Luteal Phase Length (usually 14 days):", "ar": "متوسط الأيام ما بعد الاباضة عادة 14 يوما : "}, "luteal-label": {"en": "Average Luteal Phase Length (usually 14 days):", "ar": "متوسط الأيام ما بعد الاباضة عادة 14 يوما : "},
"pregnancy-title": {"en": "Delivery Due Date", "ar": "تاريخ الولادة"}, "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-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": "ما هو تاريخ أول يوم من أخر دورة شهرية ؟"}, "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": "تقدر فترة الاباضة القادمة "}, "ovulation-period": {"en": "The next ovulation period is estimated to be: ", "ar": "تقدر فترة الاباضة القادمة "},
"from": {"en": "From: ", "ar": "من:"}, "from": {"en": "From: ", "ar": "من:"},

@ -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<TableRow> fullData(context) {
List<TableRow> 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;
}
}

@ -1,14 +1,21 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.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/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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
import 'insurance_approval_detail_screen.dart';
class InsuranceApproval extends StatefulWidget { class InsuranceApproval extends StatefulWidget {
int appointmentNo; int appointmentNo;
@ -24,6 +31,7 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
imagesInfo 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')); .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 imagesInfo
@ -35,271 +43,129 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
showNewAppBar: true, showNewAppBar: true,
baseViewModel: model, baseViewModel: model,
showNewAppBarTitle: true, showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).approvals, appBarTitle: TranslationBase.of(context).insuranceApproval,
description: TranslationBase.of(context).infoApprovals, description: TranslationBase.of(context).infoApprovals,
infoList: TranslationBase.of(context).infoApprovalPoints, infoList: TranslationBase.of(context).infoApprovalPoints,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
body: SingleChildScrollView( 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( child: Container(
margin: EdgeInsets.only( decoration: BoxDecoration(
left: SizeConfig.screenWidth * 0.004, borderRadius: BorderRadius.all(
right: SizeConfig.screenWidth * 0.004, Radius.circular(10.0),
top: SizeConfig.screenWidth * 0.04,
),
child: Column(
children: <Widget>[
Container(
width: double.infinity,
height: SizeConfig.screenHeight * 0.09,
color: Color(0xffEEEEEE),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Texts(
TranslationBase.of(context).totalApproval,
color: Color(0xff60688B),
fontSize: 19.0,
fontWeight: FontWeight.w600,
), ),
if (model.insuranceApproval.length > 0) boxShadow: [
Container( BoxShadow(
width: 60, color: Color(0xff000000).withOpacity(.05),
height: 40, //spreadRadius: 5,
decoration: BoxDecoration(color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(19.0)), blurRadius: 27,
child: Center( offset: Offset(0, -3),
child: Texts(
model.insuranceApproval[0].unUsedCount.toString(),
color: Colors.white,
fontSize: 17.0,
), ),
))
], ],
)), color: _patientStatusColor),
...List.generate(model.insuranceApproval.length, (index) { child: Row(
return RoundedContainer( children: [
backgroundColor: Colors.white, SizedBox(
child: Column( width: 16,
crossAxisAlignment: CrossAxisAlignment.start, child: RotatedBox(
children: <Widget>[ quarterTurns: 3,
ExpansionTile( child: Text(
title: Container( _patientStatusString,
//height: 120.0, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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,
),
), ),
Texts(
model.insuranceApproval[index].doctorName,
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),
), ),
children: <Widget>[ color: Colors.white),
Padding(
padding: EdgeInsets.symmetric(vertical: 12.0, horizontal: 12.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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: [ children: [
Texts( Text(
TranslationBase.of(context).procedureStatus,
fontSize: 17.5,
),
SizedBox(
width: 12,
),
Texts(
model.insuranceApproval[index].approvalStatusDescption, model.insuranceApproval[index].approvalStatusDescption,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 17.5, color: model.insuranceApproval[index].status == 9 ? Color(0xff359846) : Color(0xffD02127),
), letterSpacing: -0.4,
], height: 18 / 10),
),
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(),
fontWeight: FontWeight.w600,
fontSize: 17.5,
),
Divider(
color: Colors.black,
height: 25.0,
thickness: 1.0,
), ),
Row( Text(
children: [ model.insuranceApproval[index].doctorName,
Texts( style: TextStyle(
TranslationBase.of(context).receiptOn, fontSize: 16,
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
Texts(
model.insuranceApproval[index].receiptOn != null ? convertDateFormat(model.insuranceApproval[index].receiptOn) : "",
fontSize: 17.5,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64,
), ),
],
),
Divider(
color: Colors.black,
height: 25.0,
thickness: 1.0,
), ),
SizedBox(height: 6),
Row( Row(
children: [ children: [
Texts( LargeAvatar(
TranslationBase.of(context).expiryDate, name: model.insuranceApproval[index].doctorName,
fontSize: 17.5, url: model.insuranceApproval[index].doctorImageURL,
fontWeight: FontWeight.w600, width: 48,
height: 48,
), ),
Texts( SizedBox(width: 12),
convertDateFormat(model.insuranceApproval[index].expiryDate),
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
],
),
Divider(
color: Colors.black,
height: 55.0,
thickness: 1.2,
),
IntrinsicHeight(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expanded( Expanded(
flex: 1,
child: Column( child: Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Text(TranslationBase.of(context).procedureName), mainAxisAlignment: MainAxisAlignment.center,
Padding( children: [
padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0), myRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index]?.clinicName.toLowerCase().capitalizeFirstofEach ?? "",
child: Text( projectViewModel.isArabic),
model.insuranceApproval[index].apporvalDetails?.procedureName ?? '', myRichText(TranslationBase.of(context).approvalNo, model.insuranceApproval[index]?.approvalNo.toString() ?? "", projectViewModel.isArabic),
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15.5),
),
),
],
),
),
VerticalDivider(
width: 10.0,
thickness: 1.2,
color: Colors.black,
),
Expanded(
flex: 1,
child: Column(
children: <Widget>[
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( Container(
width: 2.3, height: 48,
thickness: 1.2, alignment: Alignment.bottomRight,
color: Colors.black, child: Icon(
), Icons.visibility_sharp,
Expanded( color: Color(0xff2E303A),
flex: 1,
child: Column(
children: <Widget>[
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,
),
],
),
), ),
], ],
), ),
],
), ),
); );
}), },
], separatorBuilder: (context, index) => SizedBox(height: 12),
), itemCount: model.insuranceApproval.length)),
),
),
),
); );
} }

@ -1,13 +1,17 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.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/pages/base/base_view.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/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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PrescriptionsHistoryDetailsPage extends StatelessWidget { class PrescriptionsHistoryDetailsPage extends StatelessWidget {
final PrescriptionsOrder prescriptionsOrder; final PrescriptionsOrder prescriptionsOrder;
@ -16,129 +20,165 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionsViewModel>( return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptionReportEnh( onModelReady: (model) => model.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder),
prescriptionsOrder: prescriptionsOrder), builder: (_, model, widget) {
builder: (_, model, widget) => AppScaffold( 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, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).orderDetails, appBarTitle: TranslationBase.of(context).orderDetails,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( showNewAppBar: true,
child: Container( backgroundColor: Color(0xffF8F8F8),
margin: EdgeInsets.all(15.0), showNewAppBarTitle: true,
child: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, children: [
Expanded(
child: ListView(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
children: <Widget>[ children: <Widget>[
SizedBox(
height: 5,
),
Container( Container(
width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: prescriptionsOrder.status == 3 ?Colors.green : prescriptionsOrder.status ==2 ? Colors.grey: Colors.red, color: _color,
borderRadius: BorderRadius.circular(5)), borderRadius: BorderRadius.all(
child: Padding( Radius.circular(10.0),
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),
), ),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
), ),
Container( ],
height: 50,
color: Colors.white,
child: Center(
child: Texts(TranslationBase.of(context).date),
),
), ),
]), child: Container(
TableRow(children: [ margin: EdgeInsets.only(left: 6),
Container( padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
height: 70, decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
child: Center( border: Border.all(color: Colors.white, width: 1),
child: Texts('${prescriptionsOrder.iD}'), borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10.0),
topRight: Radius.circular(10.0),
), ),
), ),
Container( child: Column(
height: 70, mainAxisSize: MainAxisSize.min,
color: Colors.white, children: [
child: Center( Row(
child: Texts('${prescriptionsOrder.createdOn.year}-${prescriptionsOrder.createdOn.day}-${prescriptionsOrder.createdOn.day} ${prescriptionsOrder.createdOn.hour}:${prescriptionsOrder.createdOn.minute}'), crossAxisAlignment: CrossAxisAlignment.start,
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),
), ),
])
], ],
), ),
SizedBox(
height: 15,
), ),
...List.generate( Column(
model.prescriptionReportEnhList.length, mainAxisSize: MainAxisSize.min,
(index) => Container( crossAxisAlignment: CrossAxisAlignment.end,
margin: EdgeInsets.all(8.0), children: [
color: Colors.white, Text(
child: Row( 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: <Widget>[ children: <Widget>[
ClipRRect( Container(
borderRadius: BorderRadius.all(Radius.circular(5)), 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( child: Image.network(
model.prescriptionReportEnhList[index].imageSRCUrl, model.prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover, fit: BoxFit.cover,
width: 60, width: 48,
height: 70, height: 48,
),
), ),
), ),
SizedBox(width: 14),
Expanded( Expanded(
child: Padding( child: Text(
padding: const EdgeInsets.all(8.0), (model.prescriptionReportEnhList[index].itemDescription.isNotEmpty
child: Column( ? model.prescriptionReportEnhList[index].itemDescription
crossAxisAlignment: CrossAxisAlignment.start, : model.prescriptionReportEnhList[index].itemDescriptionN ?? '')
children: <Widget>[ .toLowerCase()
Texts(model.prescriptionReportEnhList[index] .capitalizeFirstofEach,
.itemDescription), 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,)
], ],
), ),
), ),
), Container(
bottomSheet: Container( color: Colors.white,
//padding: EdgeInsets.all(8.0), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
// margin: EdgeInsets.all(8.0), child: DefaultButton(
child: BottomButton( TranslationBase.of(context).cancelOrder,
label: TranslationBase.of(context).cancelOrder, prescriptionsOrder.status != 1
disabled: prescriptionsOrder.status != 1, ? null
textColor: Colors.white, : () {
onTap: (){
showCDialog(model, context); showCDialog(model, context);
//showAlertDialog(context);
}, },
disabledColor: Color(0xff575757),
), ),
), ),
],
), ),
); );
},
);
} }
showCDialog(PrescriptionsViewModel model, context) { showCDialog(PrescriptionsViewModel model, context) {
@ -156,5 +196,4 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
cancelFunction: () => {}).showAlertDialog(context); cancelFunction: () => {}).showAlertDialog(context);
// dialog.showAlertDialog(context); // dialog.showAlertDialog(context);
} }
} }

@ -510,10 +510,14 @@ class TranslationBase {
String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; String get receiptOn => localizedValues['receiptOn'][locale.languageCode];
String get expiryOn => localizedValues['expiryOn'][locale.languageCode];
String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; String get expiryDate => localizedValues['expiryDate'][locale.languageCode];
String get procedureName => localizedValues['procedureName'][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 procedureStatus => localizedValues['procedureStatus'][locale.languageCode];
String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode];
@ -909,14 +913,10 @@ class TranslationBase {
String get productDetails => localizedValues['productDetails'][locale.languageCode]; String get productDetails => localizedValues['productDetails'][locale.languageCode];
String get noReviewsAvailable => localizedValues['noReviewsAvailable'][locale.languageCode]; String get noReviewsAvailable => localizedValues['noReviewsAvailable'][locale.languageCode];
String get noLocationAvailable => localizedValues['noLocationAvailable'][locale.languageCode]; String get noLocationAvailable => localizedValues['noLocationAvailable'][locale.languageCode];
String get myPrescriptions => String get myPrescriptions => localizedValues['myPrescriptions'][locale.languageCode];
localizedValues['myPrescriptions'][locale.languageCode]; String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode];
String get medicationRefill => String get pillReminder => localizedValues['pillReminder'][locale.languageCode];
localizedValues['medicationRefill'][locale.languageCode]; String get shippingAddresses => localizedValues['shippingAddresses'][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 reachUs => localizedValues['reachUs'][locale.languageCode];
String get ourLocations => localizedValues['ourLocations'][locale.languageCode]; String get ourLocations => localizedValues['ourLocations'][locale.languageCode];
@ -1746,12 +1746,9 @@ class TranslationBase {
String get addToCart => localizedValues['addToCart'][locale.languageCode]; String get addToCart => localizedValues['addToCart'][locale.languageCode];
String get addToWishlist => localizedValues['addToWishlist'][locale.languageCode]; String get addToWishlist => localizedValues['addToWishlist'][locale.languageCode];
String get buyNow => localizedValues['buyNow'][locale.languageCode]; String get buyNow => localizedValues['buyNow'][locale.languageCode];
String get quantityShortcut => String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode];
localizedValues['quantityShortcut'][locale.languageCode]; String get noData => localizedValues['noData'][locale.languageCode];
String get noData => String get no_data => localizedValues['no_data'][locale.languageCode];
localizedValues['noData'][locale.languageCode];
String get no_data =>
localizedValues['no_data'][locale.languageCode];
String get year => localizedValues['Year'][locale.languageCode]; String get year => localizedValues['Year'][locale.languageCode];

@ -71,7 +71,7 @@ dependencies:
#GIF image #GIF image
flutter_gifimage: ^1.0.1 flutter_gifimage: ^1.0.1
flutter_webrtc: any # flutter_webrtc: any
# UI Reqs # UI Reqs
dotted_border: 1.0.5 dotted_border: 1.0.5

Loading…
Cancel
Save