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.
79 lines
3.7 KiB
Dart
79 lines
3.7 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:provider/provider.dart';
|
|
|
|
class SearchResults extends StatelessWidget {
|
|
List<DoctorList> doctorsList = [];
|
|
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
|
|
bool isLiveCareAppointment;
|
|
bool isObGyneAppointment;
|
|
bool isDoctorNameSearch;
|
|
OBGyneProcedureListResponse? obGyneProcedureListResponse;
|
|
|
|
SearchResults(
|
|
{required this.doctorsList,
|
|
required this.patientDoctorAppointmentListHospital,
|
|
this.isObGyneAppointment = false,
|
|
this.isDoctorNameSearch = false,
|
|
required this.isLiveCareAppointment,
|
|
this.obGyneProcedureListResponse});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppScaffold(
|
|
appBarTitle: TranslationBase.of(context).bookAppo,
|
|
isShowDecPage: false,
|
|
isShowAppBar: true,
|
|
showNewAppBarTitle: true,
|
|
showNewAppBar: true,
|
|
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
|
body: patientDoctorAppointmentListHospital.isNotEmpty
|
|
? ListView.separated(
|
|
addAutomaticKeepAlives: true,
|
|
physics: BouncingScrollPhysics(),
|
|
separatorBuilder: (context, index) {
|
|
return Container(
|
|
height: 12,
|
|
margin: EdgeInsets.only(left: 21, right: 21),
|
|
);
|
|
},
|
|
itemBuilder: (context, index) {
|
|
return AppExpandableNotifier(
|
|
isTitleSingleLine: false,
|
|
isExpand: patientDoctorAppointmentListHospital.length == 1 ? true : false,
|
|
bodyWidget: ListView.separated(
|
|
shrinkWrap: true,
|
|
physics: NeverScrollableScrollPhysics(),
|
|
padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
|
|
itemBuilder: (context, _index) {
|
|
final doctor = patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList![_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);
|
|
});
|
|
},
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
itemCount: patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList!.length),
|
|
);
|
|
},
|
|
itemCount: patientDoctorAppointmentListHospital.length,
|
|
)
|
|
: getNoDataWidget(context),
|
|
);
|
|
}
|
|
}
|