From ebf293736da075c4196ff508ef838cb4a88e51f8 Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Tue, 31 Aug 2021 15:32:35 +0300 Subject: [PATCH] Booking appointment Marge --- lib/pages/BookAppointment/DoctorProfile.dart | 8 +- .../BookAppointment/widgets/DoctorView.dart | 2 +- lib/pages/MyAppointments/SchedulePage.dart | 88 ++++++------------- 3 files changed, 36 insertions(+), 62 deletions(-) diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 5fca126c..88cf53e6 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart' import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/doctor_post_pre_images_page.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; @@ -115,7 +116,12 @@ class _DoctorProfileState extends State with TickerProviderStateM widget.doctor.noOfPatientsRate, "", ), - onTap: () {}, + showConfirmMessageDialog: false, + onTap: () { + if (widget.isOpenAppt) { + Navigator.push(context, FadePage(page: SchedulePage(widget.doctor))); + } + }, onRatingAndReviewTap: () { getDoctorRatingsDetails(); }, diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 7f95b236..769231cd 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -24,7 +24,7 @@ class DoctorView extends StatelessWidget { Widget build(BuildContext context) { return InkWell( onTap: () { - if (isShowFlag) getDoctorsProfile(context, doctor); + if (isShowFlag) getDoctorsProfile(context, doctor,isAppo: true); }, child: Container( decoration: BoxDecoration( diff --git a/lib/pages/MyAppointments/SchedulePage.dart b/lib/pages/MyAppointments/SchedulePage.dart index e83e8408..f3ef3d2a 100644 --- a/lib/pages/MyAppointments/SchedulePage.dart +++ b/lib/pages/MyAppointments/SchedulePage.dart @@ -16,6 +16,7 @@ class SchedulePage extends StatefulWidget { final DoctorList doctorList; SchedulePage(this.doctorList); + @override _SchedulePageState createState() => _SchedulePageState(); } @@ -27,11 +28,7 @@ class _SchedulePageState extends State { int selectedindex = 0; bool isLoading = true; List doctorScheduleResponse = []; - final List introWidgetsList = [ - Text('Hello'), - Text('Hi'), - Text('hey') - ]; + final List introWidgetsList = [Text('Hello'), Text('Hi'), Text('hey')]; @override void initState() { @@ -70,29 +67,13 @@ class _SchedulePageState extends State { child: ListView.builder( itemCount: model.getDoctorScheduleList.length, itemBuilder: (context, index) => ClipRRect( - borderRadius: const BorderRadius.all( - Radius.circular(20.0)), + borderRadius: const BorderRadius.all(Radius.circular(20.0)), child: Container( - padding: EdgeInsets.only( - left: 10, - right: 10, - top: 20, - bottom: 20), - margin: EdgeInsets.only( - left: 20, - right: 20, - top: 7, - bottom: 7), - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.green, - offset: Offset(-10, 0)), - ], - borderRadius: - const BorderRadius.all( - Radius.circular(10.0)), - color: Colors.white), + padding: EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20), + margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7), + decoration: BoxDecoration(boxShadow: [ + BoxShadow(color: Colors.green, offset: Offset(-10, 0)), + ], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white), child: Row( children: [ Expanded( @@ -100,26 +81,16 @@ class _SchedulePageState extends State { Column( children: [ Texts( - model - .getDoctorScheduleList[ - index] - .dayName, - color: - HexColor('#0bb690'), + model.getDoctorScheduleList[index].dayName, + color: HexColor('#0bb690'), ), Texts( - DateUtil - .getDayMonthYearDateFormatted( - DateUtil - .convertStringToDate( - model - .getDoctorScheduleList[ - index] - .date, + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + model.getDoctorScheduleList[index].date, ), ), - color: - HexColor('#0bb690'), + color: HexColor('#0bb690'), ) ], ) @@ -127,10 +98,7 @@ class _SchedulePageState extends State { ), Expanded( child: Texts( - model - .getDoctorScheduleList[ - index] - .workingHours, + model.getDoctorScheduleList[index].workingHours, color: HexColor('#0bb690'), ), ) @@ -147,17 +115,17 @@ class _SchedulePageState extends State { )))); } - //getSchedule(DoctorList doctor, BuildContext context) { - //GifLoaderDialogUtils.showMyDialog(context); - //service = new DoctorsListService(); - // service.getSchedule(doctor).then((value) { - // doctorScheduleResponse.clear(); - // setState(() { - // value['List_DoctorWorkingHoursTable'].forEach((item) => { - // doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item)) - // }); - // GifLoaderDialogUtils.hideDialog(context); - // }); - // }); - // } +//getSchedule(DoctorList doctor, BuildContext context) { +//GifLoaderDialogUtils.showMyDialog(context); +//service = new DoctorsListService(); +// service.getSchedule(doctor).then((value) { +// doctorScheduleResponse.clear(); +// setState(() { +// value['List_DoctorWorkingHoursTable'].forEach((item) => { +// doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item)) +// }); +// GifLoaderDialogUtils.hideDialog(context); +// }); +// }); +// } }