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.
diplomatic-quarter/lib/pages/medical/doctor/doctor_home_page.dart

139 lines
6.4 KiB
Dart

import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'doctor_profile_page.dart';
class DoctorHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<MyDoctorViewModel>(
onModelReady: (model) => model.getMyDoctor(),
builder: (context, MyDoctorViewModel model, widget) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBarTitle: 'My Doctors',
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: FractionallySizedBox(
widthFactor: 1.0,
child: Center(
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () => model.setFilterType(FilterType.Clinic),
child: ListTile(
title: Text(TranslationBase.of(context).clinic),
leading: Radio(
value: FilterType.Clinic,
groupValue: model.filterType,
activeColor: Colors.red[800],
onChanged: (FilterType value) {
model.setFilterType(value);
},
),
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => model.setFilterType(FilterType.Hospital),
child: ListTile(
title: Text(TranslationBase.of(context).hospital),
leading: Radio(
value: FilterType.Hospital,
groupValue: model.filterType,
activeColor: Colors.red[800],
onChanged: (FilterType value) =>
model.setFilterType(value),
),
),
),
)
],
),
...List.generate(
model.patientDoctorAppointmentList.length,
(index) => AppExpandableNotifier(
title: model
.patientDoctorAppointmentList[index].filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: model.patientDoctorAppointmentList[index]
.patientDoctorAppointmentList
.map((doctor) {
DoctorList doctorList = DoctorList(
projectID: doctor.projectID,
setupID: doctor.setupID,
clinicID: doctor.clinicID,
projectName: doctor.projectName,
clinicName: doctor.clinicName,
actualDoctorRate: doctor.actualDoctorRate,
doctorID: doctor.doctorID,
doctorRate: doctor.doctorRate,
gender: doctor.gender,
doctorTitle: doctor.doctorTitle,
name: doctor.name,
doctorImageURL: doctor.doctorImageURL,
nationalityFlagURL: doctor.nationalityFlagURL);
return DoctorView(
doctor: doctorList,
);
/* InkWell(
onTap: () async {
model
.getDoctorProfileAndRating(
doctorId: doctor.doctorID,
clinicID: doctor.clinicID,
projectID: doctor.projectID)
.then((value) {
var asd="";
Navigator.push(
context,
FadePage(
page: DoctorView(doctor: model.doctorList,),
),
);
}).catchError((e){
var asd="";
});
},
child: DoctorCard(
name: doctor.doctorName,
profileUrl: doctor.doctorImageURL,
rat: doctor.doctorRate.toDouble(),
subName: DateUtil.getMonthDayYearDateFormatted(
doctor.appointmentDate),
),
)*/
;
}).toList(),
)),
)
],
),
),
),
),
),
);
}
}