You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RSGDoctorApp/lib/widgets/patients/profile/prescription_in_patinets_wi...

88 lines
4.0 KiB
Dart

import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/routes.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: () {
Navigator.of(context).pushNamed(IN_PATIENT_PRESCRIPTIONS_DETAILS, arguments: {
'prescription': prescriptionReportForInPatientList[index]
});
},
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,
),
],
),
),
)
],
),
],
),
));
},
),
),
);
}
}