|
|
|
|
@ -11,7 +11,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class PrescriptionItemsPage extends StatelessWidget {
|
|
|
|
|
final Prescriptions prescriptions;
|
|
|
|
|
@ -27,153 +26,155 @@ class PrescriptionItemsPage extends StatelessWidget {
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).prescriptions,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
body: Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.8,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
if (!prescriptions.isInOutPatient)
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.prescriptionReportList.length,
|
|
|
|
|
(index) => InkWell(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PrescriptionDetailsPage(
|
|
|
|
|
prescriptionReport:
|
|
|
|
|
model.prescriptionReportList[index],
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
if (!prescriptions.isInOutPatient)
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.prescriptionReportList.length,
|
|
|
|
|
(index) => InkWell(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PrescriptionDetailsPage(
|
|
|
|
|
prescriptionReport:
|
|
|
|
|
model.prescriptionReportList[index],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(top: 10, left: 10, right: 10),
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(10.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(top: 10, left: 10, right: 10),
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.grey[200], width: 0.5),
|
|
|
|
|
),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.grey[200], width: 0.5),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
ClipRRect(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(5)),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
model.prescriptionReportList[index]
|
|
|
|
|
.imageSRCUrl,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 70,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
ClipRRect(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(5)),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
model.prescriptionReportList[index]
|
|
|
|
|
.imageSRCUrl,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 70,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(model
|
|
|
|
|
.prescriptionReportList[index]
|
|
|
|
|
.itemDescription
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
? model.prescriptionReportList[index]
|
|
|
|
|
.itemDescription
|
|
|
|
|
: model.prescriptionReportList[index]
|
|
|
|
|
.itemDescriptionN)),
|
|
|
|
|
)),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
|
size: 18,
|
|
|
|
|
color: Colors.grey[500],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(model
|
|
|
|
|
.prescriptionReportList[index]
|
|
|
|
|
.itemDescription
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
? model.prescriptionReportList[index]
|
|
|
|
|
.itemDescription
|
|
|
|
|
: model.prescriptionReportList[index]
|
|
|
|
|
.itemDescriptionN)),
|
|
|
|
|
)),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
|
size: 18,
|
|
|
|
|
color: Colors.grey[500],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
))
|
|
|
|
|
else
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.prescriptionReportEnhList.length,
|
|
|
|
|
(index) => InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
PrescriptionReport prescriptionReport =
|
|
|
|
|
PrescriptionReport(
|
|
|
|
|
imageSRCUrl: model
|
|
|
|
|
.prescriptionReportEnhList[index].imageSRCUrl,
|
|
|
|
|
itemDescription: model
|
|
|
|
|
.prescriptionReportEnhList[index]
|
|
|
|
|
.itemDescription,
|
|
|
|
|
itemDescriptionN: model
|
|
|
|
|
.prescriptionReportEnhList[index]
|
|
|
|
|
.itemDescription,
|
|
|
|
|
routeN:
|
|
|
|
|
model.prescriptionReportEnhList[index].route,
|
|
|
|
|
frequency: model
|
|
|
|
|
.prescriptionReportEnhList[index].frequency,
|
|
|
|
|
frequencyN: model
|
|
|
|
|
.prescriptionReportEnhList[index].frequency,
|
|
|
|
|
doseDailyQuantity: model
|
|
|
|
|
.prescriptionReportEnhList[index]
|
|
|
|
|
.doseDailyQuantity,
|
|
|
|
|
days: model.prescriptionReportEnhList[index].days,
|
|
|
|
|
itemID:
|
|
|
|
|
model.prescriptionReportEnhList[index].itemID,
|
|
|
|
|
remarks: model
|
|
|
|
|
.prescriptionReportEnhList[index].remarks);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PrescriptionDetailsPage(
|
|
|
|
|
prescriptionReport: prescriptionReport,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
model
|
|
|
|
|
.prescriptionReportEnhList[index].imageSRCUrl,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 70,
|
|
|
|
|
))
|
|
|
|
|
else
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.prescriptionReportEnhList.length,
|
|
|
|
|
(index) => InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
PrescriptionReport prescriptionReport =
|
|
|
|
|
PrescriptionReport(
|
|
|
|
|
imageSRCUrl: model
|
|
|
|
|
.prescriptionReportEnhList[index].imageSRCUrl,
|
|
|
|
|
itemDescription: model
|
|
|
|
|
.prescriptionReportEnhList[index]
|
|
|
|
|
.itemDescription,
|
|
|
|
|
itemDescriptionN: model
|
|
|
|
|
.prescriptionReportEnhList[index]
|
|
|
|
|
.itemDescription,
|
|
|
|
|
routeN:
|
|
|
|
|
model.prescriptionReportEnhList[index].route,
|
|
|
|
|
frequency: model
|
|
|
|
|
.prescriptionReportEnhList[index].frequency,
|
|
|
|
|
frequencyN: model
|
|
|
|
|
.prescriptionReportEnhList[index].frequency,
|
|
|
|
|
doseDailyQuantity: model
|
|
|
|
|
.prescriptionReportEnhList[index]
|
|
|
|
|
.doseDailyQuantity,
|
|
|
|
|
days: model.prescriptionReportEnhList[index].days,
|
|
|
|
|
itemID:
|
|
|
|
|
model.prescriptionReportEnhList[index].itemID,
|
|
|
|
|
remarks: model
|
|
|
|
|
.prescriptionReportEnhList[index].remarks);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: PrescriptionDetailsPage(
|
|
|
|
|
prescriptionReport: prescriptionReport,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Texts(model.prescriptionReportEnhList[index]
|
|
|
|
|
.itemDescription),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
model
|
|
|
|
|
.prescriptionReportEnhList[index].imageSRCUrl,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 70,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
|
size: 18,
|
|
|
|
|
color: Colors.grey[500],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Texts(model.prescriptionReportEnhList[index]
|
|
|
|
|
.itemDescription),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
|
size: 18,
|
|
|
|
|
color: Colors.grey[500],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|