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.
50 lines
2.3 KiB
Dart
50 lines
2.3 KiB
Dart
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
|
import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_res_model.dart';
|
|
import 'package:doctor_app_flutter/core/model/patient/prescription/request_prescription_report.dart';
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart';
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class OutPatientPrescriptionDetailsScreen extends StatefulWidget {
|
|
final PrescriptionResModel? prescriptionResModel;
|
|
|
|
OutPatientPrescriptionDetailsScreen({Key? key, this.prescriptionResModel});
|
|
|
|
@override
|
|
_OutPatientPrescriptionDetailsScreenState createState() => _OutPatientPrescriptionDetailsScreenState();
|
|
}
|
|
|
|
class _OutPatientPrescriptionDetailsScreenState extends State<OutPatientPrescriptionDetailsScreen> {
|
|
getPrescriptionReport(BuildContext context, PatientViewModel model) {
|
|
RequestPrescriptionReport prescriptionReqModel = RequestPrescriptionReport(
|
|
appointmentNo: widget.prescriptionResModel!.appointmentNo,
|
|
episodeID: widget.prescriptionResModel!.episodeID,
|
|
setupID: widget.prescriptionResModel!.setupID,
|
|
patientTypeID: widget.prescriptionResModel!.patientID);
|
|
model.getPrescriptionReport(prescriptionReqModel.toJson());
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BaseView<PatientViewModel>(
|
|
onModelReady: (model) => getPrescriptionReport(context, model),
|
|
builder: (_, model, w) => AppScaffold(
|
|
appBarTitle: TranslationBase.of(context).prescriptionDetails,
|
|
body: CardWithBgWidgetNew(
|
|
widget: ListView.builder(
|
|
itemCount: model.prescriptionReport.length,
|
|
itemBuilder: (BuildContext context, int index) {
|
|
return OutPatientPrescriptionDetailsItem(
|
|
prescriptionReport: model.prescriptionReport[index],
|
|
);
|
|
}),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|