|
|
|
|
@ -28,20 +28,20 @@ class HomeReportPage extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProviderStateMixin {
|
|
|
|
|
TabController _tabController_new;
|
|
|
|
|
// TabController _tabController_new;
|
|
|
|
|
List<ImagesInfo> imagesInfo = List();
|
|
|
|
|
int _currentPage = 0;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
_tabController_new = TabController(length: 2, vsync: this);
|
|
|
|
|
// _tabController_new = TabController(length: 2, vsync: this);
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
super.dispose();
|
|
|
|
|
_tabController_new.dispose();
|
|
|
|
|
// _tabController_new.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -70,182 +70,185 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
|
|
|
|
|
body: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
TabBar(
|
|
|
|
|
controller: _tabController_new,
|
|
|
|
|
indicatorWeight: 3.0,
|
|
|
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
|
labelColor: Color(0xff2B353E),
|
|
|
|
|
unselectedLabelColor: Color(0xff575757),
|
|
|
|
|
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
|
|
|
|
|
labelStyle: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
),
|
|
|
|
|
unselectedLabelStyle: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
),
|
|
|
|
|
onTap: (int value) {
|
|
|
|
|
print(value);
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
tabs: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).outpatient,
|
|
|
|
|
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).inPatient,
|
|
|
|
|
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// TabBar(
|
|
|
|
|
// controller: _tabController_new,
|
|
|
|
|
// indicatorWeight: 3.0,
|
|
|
|
|
// indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
|
// labelColor: Color(0xff2B353E),
|
|
|
|
|
// unselectedLabelColor: Color(0xff575757),
|
|
|
|
|
// labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
|
|
|
|
|
// labelStyle: TextStyle(
|
|
|
|
|
// fontSize: 16,
|
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
|
// letterSpacing: -0.48,
|
|
|
|
|
// ),
|
|
|
|
|
// unselectedLabelStyle: TextStyle(
|
|
|
|
|
// fontSize: 16,
|
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
|
// letterSpacing: -0.48,
|
|
|
|
|
// ),
|
|
|
|
|
// onTap: (int value) {
|
|
|
|
|
// print(value);
|
|
|
|
|
// setState(() {});
|
|
|
|
|
// },
|
|
|
|
|
// tabs: [
|
|
|
|
|
// Text(
|
|
|
|
|
// TranslationBase.of(context).outpatient,
|
|
|
|
|
// style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
|
|
|
|
|
// ),
|
|
|
|
|
// Text(
|
|
|
|
|
// TranslationBase.of(context).inPatient,
|
|
|
|
|
// style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
if (model.user != null)
|
|
|
|
|
Expanded(
|
|
|
|
|
child: TabBarView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
controller: _tabController_new,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
child:
|
|
|
|
|
// TabBarView(
|
|
|
|
|
// physics: BouncingScrollPhysics(),
|
|
|
|
|
// controller: _tabController_new,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(21),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
myRadioButton(TranslationBase.of(context).requested, 0),
|
|
|
|
|
myRadioButton(TranslationBase.of(context).ready, 1),
|
|
|
|
|
myRadioButton(TranslationBase.of(context).cancelled, 2),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: IndexedStack(
|
|
|
|
|
index: _currentPage,
|
|
|
|
|
children: [
|
|
|
|
|
ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress),
|
|
|
|
|
ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress),
|
|
|
|
|
ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(21),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
myRadioButton(TranslationBase.of(context).requested, 0),
|
|
|
|
|
myRadioButton(TranslationBase.of(context).ready, 1),
|
|
|
|
|
myRadioButton(TranslationBase.of(context).cancelled, 2),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// InPatient Medical Reports
|
|
|
|
|
Container(
|
|
|
|
|
child: model.admissionsMedicalReportList.isNotEmpty
|
|
|
|
|
? Column(
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).selectAdmissionText,
|
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ListView.separated(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
AdmissionMedicalReport admissionMedicalReport = model.admissionsMedicalReportList[index];
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: InPatientMedicalReports(
|
|
|
|
|
admissionMedicalReport: admissionMedicalReport,
|
|
|
|
|
)));
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
// height: 100.0,
|
|
|
|
|
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: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(12.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).dr + " " + admissionMedicalReport.doctorNameObj,
|
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Text(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(admissionMedicalReport.admissionDate)),
|
|
|
|
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
|
|
|
|
|
Text(admissionMedicalReport.projectName,
|
|
|
|
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
if (admissionMedicalReport.clinicName != null)
|
|
|
|
|
MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName, projectViewModel.isArabic),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
MyRichText(
|
|
|
|
|
TranslationBase.of(context).status + ":",
|
|
|
|
|
projectViewModel.isArabic ? admissionMedicalReport.statusDescriptionN : admissionMedicalReport.statusDescription,
|
|
|
|
|
projectViewModel.isArabic),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward,
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(
|
|
|
|
|
height: 16.0,
|
|
|
|
|
),
|
|
|
|
|
itemCount: model.admissionsMedicalReportList.length),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: getNoDataWidget(context),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
Expanded(
|
|
|
|
|
child: IndexedStack(
|
|
|
|
|
index: _currentPage,
|
|
|
|
|
children: [
|
|
|
|
|
ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress),
|
|
|
|
|
ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress),
|
|
|
|
|
ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// InPatient Medical Reports
|
|
|
|
|
// Container(
|
|
|
|
|
// child: model.admissionsMedicalReportList.isNotEmpty
|
|
|
|
|
// ? Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding: const EdgeInsets.all(16.0),
|
|
|
|
|
// child: Text(
|
|
|
|
|
// TranslationBase.of(context).selectAdmissionText,
|
|
|
|
|
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ListView.separated(
|
|
|
|
|
// physics: BouncingScrollPhysics(),
|
|
|
|
|
// shrinkWrap: true,
|
|
|
|
|
// padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12),
|
|
|
|
|
// itemBuilder: (context, index) {
|
|
|
|
|
// AdmissionMedicalReport admissionMedicalReport = model.admissionsMedicalReportList[index];
|
|
|
|
|
// return InkWell(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// FadePage(
|
|
|
|
|
// page: InPatientMedicalReports(
|
|
|
|
|
// admissionMedicalReport: admissionMedicalReport,
|
|
|
|
|
// )));
|
|
|
|
|
// },
|
|
|
|
|
// child: Container(
|
|
|
|
|
// // height: 100.0,
|
|
|
|
|
// 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: Padding(
|
|
|
|
|
// padding: const EdgeInsets.all(12.0),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Text(
|
|
|
|
|
// TranslationBase.of(context).dr + " " + admissionMedicalReport.doctorNameObj,
|
|
|
|
|
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
// ),
|
|
|
|
|
// Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
// children: [
|
|
|
|
|
// Text(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(admissionMedicalReport.admissionDate)),
|
|
|
|
|
// style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
|
|
|
|
|
// Text(admissionMedicalReport.projectName,
|
|
|
|
|
// style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// if (admissionMedicalReport.clinicName != null)
|
|
|
|
|
// MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName, projectViewModel.isArabic),
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [
|
|
|
|
|
// MyRichText(
|
|
|
|
|
// TranslationBase.of(context).status + ":",
|
|
|
|
|
// projectViewModel.isArabic ? admissionMedicalReport.statusDescriptionN : admissionMedicalReport.statusDescription,
|
|
|
|
|
// projectViewModel.isArabic),
|
|
|
|
|
// Icon(
|
|
|
|
|
// Icons.arrow_forward,
|
|
|
|
|
// color: Theme.of(context).primaryColor,
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// },
|
|
|
|
|
// separatorBuilder: (context, index) => SizedBox(
|
|
|
|
|
// height: 16.0,
|
|
|
|
|
// ),
|
|
|
|
|
// itemCount: model.admissionsMedicalReportList.length),
|
|
|
|
|
// ],
|
|
|
|
|
// )
|
|
|
|
|
// : getNoDataWidget(context),
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
),
|
|
|
|
|
if (projectViewModel.havePrivilege(21) && _tabController_new.index == 0)
|
|
|
|
|
if (projectViewModel.havePrivilege(21)
|
|
|
|
|
// && _tabController_new.index == 0
|
|
|
|
|
)
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
|