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.
146 lines
4.8 KiB
Dart
146 lines
4.8 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';
|
|
typedef OnRegionSelected = Function(String);
|
|
class ResultByRegion extends StatelessWidget {
|
|
List<DoctorList> doctorsList = [];
|
|
RegionList patientDoctorAppointmentListHospital;
|
|
OnRegionSelected onRegionSelected;
|
|
ResultByRegion(
|
|
{required this.doctorsList,
|
|
required this.patientDoctorAppointmentListHospital,
|
|
required this.onRegionSelected
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
children: [
|
|
Expanded(
|
|
child: patientDoctorAppointmentListHospital
|
|
.registeredDoctorMap?.isNotEmpty ==
|
|
true
|
|
? ListView.separated(
|
|
addAutomaticKeepAlives: true,
|
|
physics: BouncingScrollPhysics(),
|
|
separatorBuilder: (context, index) {
|
|
return Material(
|
|
color: Color(0xFFf5f5f5),
|
|
child: SizedBox(
|
|
height: 12,
|
|
),
|
|
);
|
|
},
|
|
itemBuilder: (context, index) {
|
|
String key = patientDoctorAppointmentListHospital
|
|
.registeredDoctorMap?.keys
|
|
.toList()[index] ??
|
|
'';
|
|
|
|
return InkWell(
|
|
onTap: (){
|
|
onRegionSelected(key);
|
|
},
|
|
child: RegionTitle(
|
|
title: key,
|
|
hmcCount:
|
|
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}",
|
|
hmgCount:
|
|
"${patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}",
|
|
),
|
|
);
|
|
|
|
},
|
|
itemCount: patientDoctorAppointmentListHospital
|
|
.registeredDoctorMap?.length ??
|
|
0,
|
|
)
|
|
: getNoDataWidget(context),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
class RegionTitle extends StatelessWidget {
|
|
final String title;
|
|
final String hmcCount;
|
|
final String hmgCount;
|
|
|
|
const RegionTitle(
|
|
{super.key,
|
|
required this.title,
|
|
required this.hmcCount,
|
|
required this.hmgCount});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Material(
|
|
color: CustomColors.white,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
title,
|
|
style: TextStyle(
|
|
fontSize: 22, color: Colors.black, fontWeight: FontWeight.w700),
|
|
),
|
|
SizedBox(
|
|
height: 8,
|
|
),
|
|
Row(
|
|
children: [
|
|
Text(
|
|
"${TranslationBase.of(context).hmgHospitalCount.replaceAll("@", hmgCount)} ,",
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: Color(0xFFD02127),
|
|
fontWeight: FontWeight.w600),
|
|
),
|
|
SizedBox(
|
|
width: 8,
|
|
),
|
|
Text(
|
|
"${TranslationBase.of(context).hmcHospitalCount.replaceAll("@", hmcCount)}",
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: Color(0xFF40ACC9),
|
|
fontWeight: FontWeight.w600),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.all(8),
|
|
child: Center(
|
|
child: Icon(
|
|
Icons.arrow_forward_ios,
|
|
color: CustomColors.black,
|
|
size: 16,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
)
|
|
),
|
|
);
|
|
}
|
|
}
|