medical file hot fix

merge-requests/572/head
hussam al-habibeh 4 years ago
parent 45e9ee60a9
commit 0e836c67c8

@ -85,6 +85,14 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.timeLineEvents[0]
.consulations
.length !=
0)
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -144,21 +152,36 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
); );
}, },
child: DoctorCard( child: DoctorCard(
doctorName: model.medicalFileList[0] doctorName: model
.entityList[0].timelines[index].doctorName, .medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName,
clinic: model.medicalFileList[0].entityList[0] clinic: model.medicalFileList[0].entityList[0]
.timelines[index].clinicName, .timelines[index].clinicName,
branch: model.medicalFileList[0].entityList[0] branch: model.medicalFileList[0].entityList[0]
.timelines[index].projectName, .timelines[index].projectName,
profileUrl: model.medicalFileList[0] profileUrl: model
.entityList[0].timelines[index].doctorImage, .medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorImage,
appointmentDate: appointmentDate:
DateUtils.getDateTimeFromServerFormat( DateUtils.getDateTimeFromServerFormat(
model.medicalFileList[0].entityList[0] model.medicalFileList[0].entityList[0]
.timelines[index].date, .timelines[index].date,
), ),
isPrescriptions: true, isPrescriptions: true,
), isShowEye: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.timeLineEvents[0]
.consulations
.length !=
0
? true
: false),
); );
}) })
: Center( : Center(

@ -21,6 +21,7 @@ class DoctorCard extends StatelessWidget {
final Function onTap; final Function onTap;
final bool isPrescriptions; final bool isPrescriptions;
final String clinic; final String clinic;
final bool isShowEye;
DoctorCard( DoctorCard(
{this.doctorName, {this.doctorName,
@ -31,7 +32,8 @@ class DoctorCard extends StatelessWidget {
this.appointmentDate, this.appointmentDate,
this.orderNo, this.orderNo,
this.isPrescriptions = false, this.isPrescriptions = false,
this.clinic}); this.clinic,
this.isShowEye = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -50,7 +52,7 @@ class DoctorCard extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: InkWell( child: InkWell(
onTap: onTap, onTap: (isShowEye) ? onTap : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -169,6 +171,7 @@ class DoctorCard extends StatelessWidget {
]), ]),
), ),
), ),
if (isShowEye)
Icon( Icon(
EvaIcons.eye, EvaIcons.eye,
) )

Loading…
Cancel
Save