diff --git a/lib/controllers/notification/firebase_notification_manger.dart b/lib/controllers/notification/firebase_notification_manger.dart index 16abd263..7a8a67f9 100644 --- a/lib/controllers/notification/firebase_notification_manger.dart +++ b/lib/controllers/notification/firebase_notification_manger.dart @@ -9,6 +9,7 @@ import 'package:test_sa/controllers/notification/notification_manger.dart'; import 'package:test_sa/models/device/device_transfer.dart'; import 'package:test_sa/models/new_models/gas_refill_model.dart'; import 'package:test_sa/modules/cm_module/views/service_request_detail_main_view.dart'; +import 'package:test_sa/modules/cx_module/survey/survey_page.dart'; import 'package:test_sa/modules/pm_module/ppm_wo/ppm_details_page.dart'; import 'package:test_sa/modules/pm_module/recurrent_wo/recurrent_work_order_view.dart'; import 'package:test_sa/views/pages/device_transfer/device_transfer_details.dart'; @@ -120,6 +121,9 @@ class FirebaseNotificationManger { break; case "12": serviceClass = RecurrentWorkOrderView(taskId: int.parse(messageData["requestNumber"].toString())); + case "17": + serviceClass = SurveyPage(surveyId: int.parse(messageData["requestNumber"].toString())); + //Didn't handle task request yet... // case 6: // serviceClass = TaskRequestDetailsView( diff --git a/lib/models/system_notification_model.dart b/lib/models/system_notification_model.dart index f307b289..e2cf4b39 100644 --- a/lib/models/system_notification_model.dart +++ b/lib/models/system_notification_model.dart @@ -13,7 +13,7 @@ class SystemNotificationModel { String? modifiedOn; String? priorityName; String? statusName; - int ? transactionType; + int? transactionType; SystemNotificationModel( {this.userId, @@ -29,7 +29,7 @@ class SystemNotificationModel { this.createdOn, this.modifiedOn, this.priorityName, - this.transactionType, + this.transactionType, this.statusName}); SystemNotificationModel.fromJson(Map? json) { diff --git a/lib/modules/cm_module/views/service_request_detail_main_view.dart b/lib/modules/cm_module/views/service_request_detail_main_view.dart index e13d41eb..65b93daf 100644 --- a/lib/modules/cm_module/views/service_request_detail_main_view.dart +++ b/lib/modules/cm_module/views/service_request_detail_main_view.dart @@ -85,12 +85,6 @@ class _ServiceRequestDetailMainState extends State { Navigator.pop(context); }, actions: [ - IconButton( - icon: const Icon(Icons.feedback_rounded), - onPressed: () { - Navigator.push(context, CupertinoPageRoute(builder: (context) => SurveyPage(moduleId: 1, requestId: widget.requestId, surveyId: 5))); - }, - ), Selector( selector: (_, myModel) => myModel.isLoading, // Selects only the userName builder: (_, isLoading, __) { diff --git a/lib/modules/cx_module/survey/survey_page.dart b/lib/modules/cx_module/survey/survey_page.dart index 1975eef3..e061050c 100644 --- a/lib/modules/cx_module/survey/survey_page.dart +++ b/lib/modules/cx_module/survey/survey_page.dart @@ -18,11 +18,13 @@ import 'package:test_sa/new_views/common_widgets/default_app_bar.dart'; import 'survey_provider.dart'; class SurveyPage extends StatefulWidget { - int moduleId; - int requestId; + // int moduleId; + // int requestId; int surveyId; - SurveyPage({Key? key, required this.moduleId, required this.requestId, required this.surveyId}) : super(key: key); + SurveyPage({Key? key, + // required this.moduleId, required this.requestId, + required this.surveyId}) : super(key: key); @override _SurveyPageState createState() { diff --git a/lib/views/pages/user/notifications/notifications_page.dart b/lib/views/pages/user/notifications/notifications_page.dart index 47b64d00..8c551b45 100644 --- a/lib/views/pages/user/notifications/notifications_page.dart +++ b/lib/views/pages/user/notifications/notifications_page.dart @@ -37,12 +37,11 @@ class _NotificationsPageState extends State with TickerProvid stateCode: _notificationsProvider.stateCode, onRefresh: () async { _notificationsProvider.reset(); - await _notificationsProvider.getSystemNotifications( - user: _userProvider.user!,resetProvider: true + await _notificationsProvider.getSystemNotifications(user: _userProvider.user!, resetProvider: true - // host: _settingProvider.host, - // hospitalId: _userProvider.user.clientId, - ); + // host: _settingProvider.host, + // hospitalId: _userProvider.user.clientId, + ); }, child: NotificationsList( nextPage: _notificationsProvider.nextPage, diff --git a/lib/views/widgets/notifications/notification_item.dart b/lib/views/widgets/notifications/notification_item.dart index 89fef4b5..71135557 100644 --- a/lib/views/widgets/notifications/notification_item.dart +++ b/lib/views/widgets/notifications/notification_item.dart @@ -28,14 +28,14 @@ class NotificationItem extends StatelessWidget { label: notification.priorityName, textColor: AppColor.getRequestStatusTextColorByName(context, notification.priorityName!), backgroundColor: AppColor.getRequestStatusColorByName(context, notification.priorityName!), - ).toShimmer(isShow: isLoading,context: context), + ).toShimmer(isShow: isLoading, context: context), 8.width, if ((notification.statusName ?? "").isNotEmpty && notification.sourceName != "Asset Transfer") StatusLabel( label: notification.statusName ?? "", textColor: AppColor.getRequestStatusTextColorByName(context, notification.statusName ?? ""), backgroundColor: AppColor.getRequestStatusColorByName(context, notification.statusName ?? ""), - ).toShimmer(isShow: isLoading,context: context), + ).toShimmer(isShow: isLoading, context: context), ], ), 8.height, @@ -47,7 +47,7 @@ class NotificationItem extends StatelessWidget { style: AppTextStyles.heading6.copyWith( color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, ), - ).toShimmer(isShow: isLoading,context: context).expanded, + ).toShimmer(isShow: isLoading, context: context).expanded, 8.width, Text( notification.createdOn?.toServiceRequestCardFormat ?? "", @@ -55,7 +55,7 @@ class NotificationItem extends StatelessWidget { style: AppTextStyles.tinyFont.copyWith( color: context.isDark ? AppColor.neutral20 : AppColor.neutral50, ), - ).toShimmer(isShow: isLoading,context: context), + ).toShimmer(isShow: isLoading, context: context), ], ), Text( @@ -63,7 +63,7 @@ class NotificationItem extends StatelessWidget { style: AppTextStyles.bodyText2.copyWith( color: context.isDark ? AppColor.neutral10 : const Color(0xFF757575), ), - ).toShimmer(isShow: isLoading,context: context), + ).toShimmer(isShow: isLoading, context: context), ], ).onPress(() { onPressed(notification);