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.
HMG_Patient_App/lib/pages/BookAppointment/search_result/ResultByDoctors.dart

77 lines
2.9 KiB
Dart

import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class ResultByDoctor extends StatelessWidget {
List<DoctorList> doctorsList = [];
List<DoctorList>? patientDoctorAppointmentListHospital;
Function(int) onDoctorSelected;
final bool isLiveCareAppointment;
final bool isObGyneAppointment;
final bool isDoctorNameSearch;
final bool isDoctorSearchResult;
final OBGyneProcedureListResponse? obGyneProcedureListResponse;
ResultByDoctor(
{required this.doctorsList,
required this.patientDoctorAppointmentListHospital,
required this.onDoctorSelected,
required this.isLiveCareAppointment,
required this.isObGyneAppointment,
required this.isDoctorNameSearch,
required this.isDoctorSearchResult,
this.obGyneProcedureListResponse,
});
@override
Widget build(BuildContext context) {
return SizedBox(
child: patientDoctorAppointmentListHospital?.isNotEmpty ==
true
? ListView.separated(
addAutomaticKeepAlives: true,
physics: BouncingScrollPhysics(),
separatorBuilder: (context, index) {
return Material(
color: Color(0xFFf5f5f5),
child: SizedBox(
height: 12,
),
);
},
itemBuilder: (context, index) {
final doctor = patientDoctorAppointmentListHospital![index];
return DoctorView(
doctor: doctor,
isLiveCareAppointment: isLiveCareAppointment,
isObGyneAppointment: isObGyneAppointment,
isDoctorNameSearch: isDoctorNameSearch,
obGyneProcedureListResponse: obGyneProcedureListResponse,
isShowDate: false,
onTap: () {
context
.read<ProjectViewModel>()
.analytics
.appointment
.book_appointment_select_doctor(
appointment_type: 'regular', doctor: doctor);
});
},
itemCount: patientDoctorAppointmentListHospital?.length ??
0,
)
: getNoDataWidget(context),
);
}
}