create Prescription In and Out Patient
parent
ec81a16c0d
commit
2ad96dad88
@ -0,0 +1,82 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/prescription_report_for_in_patient.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'large_avatar.dart';
|
||||
|
||||
class PrescriptionInPatientWidget extends StatelessWidget {
|
||||
final List<PrescriptionReportForInPatient> prescriptionReportForInPatientList;
|
||||
|
||||
PrescriptionInPatientWidget(
|
||||
{Key key, this.prescriptionReportForInPatientList});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: prescriptionReportForInPatientList.length == 0
|
||||
? DrAppEmbeddedError(error: 'You don\'t have any Prescriptions')
|
||||
: Container(
|
||||
margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0,
|
||||
SizeConfig.realScreenWidth * 0.05, 0),
|
||||
child: ListView.builder(
|
||||
itemCount: prescriptionReportForInPatientList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: () {},
|
||||
child: CardWithBgWidgetNew(
|
||||
widget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
LargeAvatar(
|
||||
name:
|
||||
prescriptionReportForInPatientList[index]
|
||||
.createdByName,
|
||||
radius: 10,
|
||||
width: 70,
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 15, right: 15),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
'${prescriptionReportForInPatientList[index].createdByName}',
|
||||
fontSize:
|
||||
2.5 * SizeConfig.textMultiplier,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
AppText(
|
||||
'${prescriptionReportForInPatientList[index].itemDescription}',
|
||||
fontSize:
|
||||
2.5 * SizeConfig.textMultiplier,
|
||||
color:
|
||||
Theme.of(context).primaryColor),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'large_avatar.dart';
|
||||
|
||||
class PrescriptionOutPatientWidget extends StatelessWidget {
|
||||
final List<PrescriptionResModel> patientPrescriptionsList;
|
||||
|
||||
PrescriptionOutPatientWidget({Key key, this.patientPrescriptionsList});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: patientPrescriptionsList.length == 0
|
||||
? DrAppEmbeddedError(error: 'You don\'t have any Prescriptions')
|
||||
: Container(
|
||||
margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0,
|
||||
SizeConfig.realScreenWidth * 0.05, 0),
|
||||
child: ListView.builder(
|
||||
itemCount: patientPrescriptionsList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: () {},
|
||||
child: CardWithBgWidgetNew(
|
||||
widget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
LargeAvatar(
|
||||
url: patientPrescriptionsList[index]
|
||||
.doctorImageURL,
|
||||
name: patientPrescriptionsList[index]
|
||||
.doctorName,
|
||||
radius: 10,
|
||||
width: 70,
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 15, right: 15),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
'${patientPrescriptionsList[index].name}',
|
||||
fontSize:
|
||||
2.5 * SizeConfig.textMultiplier,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
AppText(
|
||||
'${patientPrescriptionsList[index].clinicDescription}',
|
||||
fontSize:
|
||||
2.5 * SizeConfig.textMultiplier,
|
||||
color:
|
||||
Theme.of(context).primaryColor),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue