Merge branch 'favorite_procedure_templates' into 'development'

Fix medical report

See merge request Cloud_Solution/doctor_app_flutter!707
merge-requests/708/merge
Mohammad Aljammal 5 years ago
commit 8cdcd51086

@ -10,6 +10,8 @@ import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -78,7 +80,7 @@ class MedicalReportDetailPage extends StatelessWidget {
data: medicalReport.reportDataHtml ?? "" data: medicalReport.reportDataHtml ?? ""
), ),
) : Container( ) : Container(
child: ErrorMessage(error: "No Data",),
), ),
], ],
), ),

@ -88,122 +88,122 @@ class MedicalReportPage extends StatelessWidget {
if (model.state != ViewState.ErrorLocal) if (model.state != ViewState.ErrorLocal)
...List.generate( ...List.generate(
model.medicalReportList.length, model.medicalReportList.length,
(index) => Container( (index) => InkWell(
margin: EdgeInsets.symmetric(horizontal: 8), onTap: (){
child: CardWithBgWidget( if (model.medicalReportList[index].status ==
hasBorder: false, 1) {
bgColor: model.medicalReportList[index].status == 1 Navigator.of(context).pushNamed(
? Colors.red[700] PATIENT_MEDICAL_REPORT_DETAIL,
: Colors.green[700], arguments: {
widget: Column( 'patient': patient,
children: [ 'patientType': patientType,
Row( 'arrivalType': arrivalType,
children: [ 'medicalReport':
Expanded( model.medicalReportList[index]
child: Column( });
crossAxisAlignment: CrossAxisAlignment.start, } else {
children: [ Navigator.of(context).pushNamed(
AppText( PATIENT_MEDICAL_REPORT_INSERT,
model.medicalReportList[index].status == 1 arguments: {
? TranslationBase.of(context).onHold 'patient': patient,
: TranslationBase.of(context).verified, 'patientType': patientType,
color: 'arrivalType': arrivalType,
model.medicalReportList[index].status == 'type': MedicalReportStatus.ADD,
1 'medicalReport':
? Colors.red[700] model.medicalReportList[index]
: Colors.green[700], });
fontSize: 1.4 * SizeConfig.textMultiplier, }
bold: true, },
), child: Container(
AppText( margin: EdgeInsets.symmetric(horizontal: 8),
projectViewModel.isArabic child: CardWithBgWidget(
? model.medicalReportList[index] hasBorder: false,
.doctorNameN bgColor: model.medicalReportList[index].status == 1
: model.medicalReportList[index] ? Colors.red[700]
.doctorName, : Colors.green[700],
fontSize: 1.9 * SizeConfig.textMultiplier, widget: Column(
fontWeight: FontWeight.w700, children: [
color: Color(0xFF2E303A), Row(
), children: [
], Expanded(
)), child: Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end, children: [
children: [ AppText(
AppText( model.medicalReportList[index].status == 1
'${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}', ? TranslationBase.of(context).onHold
color: Color(0xFF2E303A), : TranslationBase.of(context).verified,
fontWeight: FontWeight.w600, color:
fontSize: 1.6 * SizeConfig.textMultiplier, model.medicalReportList[index].status ==
), 1
AppText( ? Colors.red[700]
'${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}', : Colors.green[700],
color: Color(0xFF2E303A), fontSize: 1.4 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w600, bold: true,
fontSize: 1.5 * SizeConfig.textMultiplier, ),
), AppText(
], projectViewModel.isArabic
), ? model.medicalReportList[index]
], .doctorNameN
), : model.medicalReportList[index]
Row( .doctorName,
crossAxisAlignment: CrossAxisAlignment.end, fontSize: 1.9 * SizeConfig.textMultiplier,
children: [ fontWeight: FontWeight.w700,
Container( color: Color(0xFF2E303A),
margin: EdgeInsets.only( ),
left: 0, top: 4, right: 8, bottom: 0), ],
child: LargeAvatar( )),
name: projectViewModel.isArabic Column(
? model crossAxisAlignment: CrossAxisAlignment.end,
.medicalReportList[index].doctorNameN children: [
: model AppText(
.medicalReportList[index].doctorName, '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}',
url: model color: Color(0xFF2E303A),
.medicalReportList[index].doctorImageURL, fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
AppText(
'${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}',
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
fontSize: 1.5 * SizeConfig.textMultiplier,
),
],
), ),
width: 50, ],
height: 50, ),
), Row(
Expanded( crossAxisAlignment: CrossAxisAlignment.end,
child: Container( children: [
Container(
margin: EdgeInsets.only(
left: 0, top: 4, right: 8, bottom: 0),
child: LargeAvatar(
name: projectViewModel.isArabic
? model
.medicalReportList[index].doctorNameN
: model
.medicalReportList[index].doctorName,
url: model
.medicalReportList[index].doctorImageURL,
),
width: 50,
height: 50, height: 50,
child: AppText( ),
TranslationBase.of(context).showDetail, Expanded(
fontSize: 1.4 * SizeConfig.textMultiplier, child: Container(
height: 50,
child: AppText(
TranslationBase.of(context).showDetail,
fontSize: 1.4 * SizeConfig.textMultiplier,
),
), ),
// child: Html(
// data: model.medicalReportList[index]
// .reportDataHtml ??
// ""),
), ),
// child: Html( Container(
// data: model.medicalReportList[index]
// .reportDataHtml ??
// ""),
),
Container(
child: InkWell(
onTap: () {
if (model.medicalReportList[index].status ==
1) {
Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_DETAIL,
arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'medicalReport':
model.medicalReportList[index]
});
} else {
Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_INSERT,
arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'type': MedicalReportStatus.ADD,
'medicalReport':
model.medicalReportList[index]
});
}
},
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
@ -215,15 +215,16 @@ class MedicalReportPage extends StatelessWidget {
), ),
], ],
), ),
), )
) ],
], ),
), ],
], ),
), ),
), ),
), ),
), ),
SizedBox(height: 15,)
], ],
), ),
), ),

Loading…
Cancel
Save