|
|
|
|
@ -21,64 +21,112 @@ class PrescriptionsHistoryPage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
baseViewModel: prescriptionsViewModel,
|
|
|
|
|
body: ListView.builder(
|
|
|
|
|
body: ListView.separated(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
itemBuilder: (context, index) => InkWell(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PrescriptionsHistoryDetailsPage(
|
|
|
|
|
prescriptionsOrder:
|
|
|
|
|
prescriptionsViewModel.prescriptionsHistory[index],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(15.0),
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
decoration:
|
|
|
|
|
BoxDecoration(shape: BoxShape.rectangle, color: Colors.white),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Texts(
|
|
|
|
|
DateUtil.getDayMonthYearHourMinuteDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn),
|
|
|
|
|
fontWeight: FontWeight.w300,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
'${TranslationBase.of(context).orderNo} ${prescriptionsViewModel.prescriptionsHistory[index].iD}'),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
'${prescriptionsViewModel.prescriptionsHistory[index].descriptionN}'),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
padding: EdgeInsets.all(21),
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
return SizedBox(height: 12);
|
|
|
|
|
},
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
int status = prescriptionsViewModel.prescriptionsHistory[index].status;
|
|
|
|
|
String _statusDisp = projectViewModel.isArabic ? prescriptionsViewModel.prescriptionsHistory[index].descriptionN : prescriptionsViewModel.prescriptionsHistory[index].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 InkWell(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PrescriptionsHistoryDetailsPage(
|
|
|
|
|
prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index],
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
'${TranslationBase.of(context).orderNo}',
|
|
|
|
|
fontWeight: FontWeight.w300,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 65,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Color(0xff000000).withOpacity(.05),
|
|
|
|
|
blurRadius: 27,
|
|
|
|
|
offset: Offset(0, -3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: 6,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: _color,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(10.0),
|
|
|
|
|
bottomLeft: Radius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 12, right: 12),
|
|
|
|
|
child: Row(
|
|
|
|
|
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}. ${prescriptionsViewModel.prescriptionsHistory[index].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(prescriptionsViewModel.prescriptionsHistory[index].createdOn, projectViewModel.isArabic),
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
DateUtil.formatDateToTime(prescriptionsViewModel.prescriptionsHistory[index].createdOn),
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
|
size: 25,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
itemCount: prescriptionsViewModel.prescriptionsHistory.length,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|