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.
doctor_app_flutter/lib/screens/patients/profile/reservation/PatientReservationPage.dart

140 lines
5.8 KiB
Dart

import 'package:doctor_app_flutter/core/viewModel/reservationViewModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/doctor_card.dart';
import 'package:flutter/material.dart';
class PatientReservationPage extends StatelessWidget {
const PatientReservationPage() : super();
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
return BaseView<ReservationViewModel>(
onModelReady: (model) => model.getPatientReservationDetails(patient),
builder: (_, model, widget) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileAppBar(patient),
appBarTitle: TranslationBase.of(context).reservation,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patient,
style: "caption2",
color: Colors.black,
fontSize: 13,
),
AppText(
TranslationBase.of(context).reservation,
bold: true,
fontSize: 22,
),
],
),
),
AddNewOrder(
onTap: () {
/* Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
model: model,
procedureType: ProcedureType.LAB_RESULT,
),
settings: RouteSettings(name: 'AddProcedureTabPage'),
),
);*/
},
label: TranslationBase.of(context).applyForNewOperationReport,
),
if (model.reservationDetailsList != null &&
model.reservationDetailsList.length > 0)
ListView.builder(
itemCount: model.reservationDetailsList.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
),
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
color: Colors.white),
child: DoctorCard(
isNoMargin: true,
// onTap: () => Navigator.push(
// context,
// FadePage(
// page: LaboratoryResultPage(
// patientLabOrders: model.patientLabOrdersList[index],
// patient: patient,
// isInpatient: isInpatient,
// arrivalType: arrivalType,
// patientType: patientType,
// ),
// ),
// ),
doctorName: model.reservationDetailsList[index].doctorName,
invoiceNO: ' ${model.reservationDetailsList[index].oTReservationID}',
profileUrl: '',
branch: '',
clinic: model.reservationDetailsList[index].clinicDescription,
appointmentDate: AppDateUtils.convertStringToDate(model.reservationDetailsList[index].oTReservationDate),
orderNo: "${model.reservationDetailsList[index].admissionRequestNo}",
isShowTime: false,
),
);
},
)
else
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText('No Reservation Found'),
)
],
),
),
],
),
),
),
);
}
}