From 47779f6fa72c16d4ddb064d1a909157df3b57027 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 14 Dec 2023 10:47:43 +0300 Subject: [PATCH] last appointment rating fixed --- .../medical/ask_doctor/request_type.dart | 3 ++- .../rate_appointment_doctor.dart | 25 ++++++++++++++----- lib/uitl/push-notification-handler.dart | 8 +++--- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart index 4c21e826..bb868e7b 100644 --- a/lib/pages/medical/ask_doctor/request_type.dart +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -27,7 +27,8 @@ class _RequestTypePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getQuestionTypes(), + // onModelReady: (model) => model.getQuestionTypes(), + onModelReady: (model) => model.getCallRequestTypeLOVs(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).requestType, diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 5127dfa6..aa49d15a 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_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'; @@ -15,6 +16,7 @@ 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 'package:provider/provider.dart'; class RateAppointmentDoctor extends StatefulWidget { @@ -30,9 +32,11 @@ class _RateAppointmentDoctorState extends State { final formKey = GlobalKey(); String note = ""; int rating = 0; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, @@ -189,12 +193,21 @@ class _RateAppointmentDoctorState extends State { }); dialog.showAlertDialog(context); } else { - Navigator.pop( - context, - // FadePage( - // page: LandingPage(), - // ), - ); + if(projectViewModel.isLoginChild) { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ); + } else { + Navigator.pop( + context, + // FadePage( + // page: LandingPage(), + // ), + ); + } } }, color: CustomColors.accentColor, diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 03e6ec29..c66a8215 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -303,9 +303,11 @@ class PushNotificationHandler { onToken(token); }); - FirebaseMessaging.instance.getAPNSToken().then((value) { - print("Push APNS getToken: " + value); - }); + if(Platform.isIOS) { + FirebaseMessaging.instance.getAPNSToken().then((value) { + print("Push APNS getToken: " + value); + }); + } FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); }