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/uitl/utils_new.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class ResultByDoctor extends StatefulWidget { List doctorsList = []; List? patientDoctorAppointmentListHospital; final bool isLiveCareAppointment; final bool isObGyneAppointment; final bool isDoctorNameSearch; final bool isDoctorSearchResult; final OBGyneProcedureListResponse? obGyneProcedureListResponse; ResultByDoctor( {required this.doctorsList, required this.patientDoctorAppointmentListHospital, required this.isLiveCareAppointment, required this.isObGyneAppointment, required this.isDoctorNameSearch, required this.isDoctorSearchResult, this.obGyneProcedureListResponse, }); @override State createState() => _ResultByDoctorState(); } class _ResultByDoctorState extends State { @override Widget build(BuildContext context) { return SizedBox( child: widget.patientDoctorAppointmentListHospital?.isNotEmpty == true ? Padding( padding: const EdgeInsets.all(12.0), child: ListView.separated( addAutomaticKeepAlives: true, physics: BouncingScrollPhysics(), separatorBuilder: (context, index) { return Material( color: Color(0xFFf5f5f5), child: SizedBox( height: 12, ), ); }, itemBuilder: (context, index) { final doctor = widget.patientDoctorAppointmentListHospital![index]; return DoctorView( doctor: doctor, isLiveCareAppointment: widget.isLiveCareAppointment, isObGyneAppointment: widget.isObGyneAppointment, isDoctorNameSearch: widget.isDoctorNameSearch, obGyneProcedureListResponse: widget.obGyneProcedureListResponse, isShowDate: false, onTap: () { context .read() .analytics .appointment .book_appointment_select_doctor( appointment_type: 'regular', doctor: doctor); }); }, itemCount: widget.patientDoctorAppointmentListHospital?.length ?? 0, ), ) : getNoDataWidget(context), ); } @override void dispose() { super.dispose(); } }