InPatient medical report & view medical report commented out

Dev_3.3_MedicalReportCR
haroon amjad 3 years ago
parent 2bf8d454f5
commit 7702960bb5

@ -37,7 +37,7 @@ class ReportsViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
_filterList(); _filterList();
await _reportsService.getInpatientAdmissionsList(); // await _reportsService.getInpatientAdmissionsList();
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

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

@ -117,23 +117,23 @@ class ReportListWidget extends StatelessWidget {
if (reportList[index].status == 2) if (reportList[index].status == 2)
Row( Row(
children: [ children: [
InkWell( // InkWell(
onTap: () { // onTap: () {
getMedicalReportPDF(report); // getMedicalReportPDF(report);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.only(right: 11.0, left: 11.0), // padding: const EdgeInsets.only(right: 11.0, left: 11.0),
child: Text(TranslationBase.of(context).viewReport, // child: Text(TranslationBase.of(context).viewReport,
style: TextStyle( // style: TextStyle(
fontSize: 12, // fontSize: 12,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
fontStyle: FontStyle.italic, // fontStyle: FontStyle.italic,
color: CustomColors.accentColor, // color: CustomColors.accentColor,
letterSpacing: -0.48, // letterSpacing: -0.48,
height: 18 / 12, // height: 18 / 12,
decoration: TextDecoration.underline)), // decoration: TextDecoration.underline)),
), // ),
), // ),
IconButton( IconButton(
icon: Icon(Icons.email), icon: Icon(Icons.email),
color: Color(0xff28323A), color: Color(0xff28323A),

Loading…
Cancel
Save