haroon_dev #345

Merged
Haroon6138 merged 3 commits from haroon_dev into master 1 week ago

@ -5,7 +5,7 @@ import 'package:hmg_patient_app_new/core/enums.dart';
class ApiConsts { class ApiConsts {
static const maxSmallScreen = 660; static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT
@ -301,7 +301,7 @@ class ApiConsts {
static String googleCloudStorageENTranslationFileBaseURL = "https://storage.googleapis.com/hmg-patientapp-translations"; static String googleCloudStorageENTranslationFileBaseURL = "https://storage.googleapis.com/hmg-patientapp-translations";
// ************ static values for Api **************** // ************ static values for Api ****************
static final double appVersionID = 21.6; static final double appVersionID = 21.7;
// static final double appVersionID = 50.7; // static final double appVersionID = 50.7;
static final int appChannelId = 3; static final int appChannelId = 3;

@ -18,6 +18,10 @@ class TurnstileService {
// Initialize an instance of invisible Cloudflare Turnstile with your site key // Initialize an instance of invisible Cloudflare Turnstile with your site key
final turnstile = CloudflareTurnstile.invisible( final turnstile = CloudflareTurnstile.invisible(
siteKey: _siteKey, siteKey: _siteKey,
onTimeout: () {},
options: TurnstileOptions(
retryInterval: const Duration(milliseconds: 2000),
),
); );
try { try {

@ -19,7 +19,12 @@ import 'package:hmg_patient_app_new/core/api/api_client.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart'; import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/features/notifications/models/resp_models/notification_response_model.dart';
import 'package:hmg_patient_app_new/presentation/notifications/notification_details_page.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
@ -523,6 +528,26 @@ class PushNotificationHandler {
_incomingCall(remoteMessage.data); _incomingCall(remoteMessage.data);
// showCallkitIncoming(); // showCallkitIncoming();
} else { } else {
NotificationResponseModel notification = NotificationResponseModel();
notification.createdOn = DateUtil.convertDateToString(DateTime.now());
notification.isSentOn = DateUtil.convertDateToString(DateTime.now());
notification.messageTypeData = remoteMessage.data['picture'];
notification.messageType = notification.messageTypeData != null && notification.messageTypeData!.isNotEmpty ? "image" : "";
notification.message = remoteMessage.data['message'];
notification.notificationType = remoteMessage.data["NotificationType"].toString();
if (remoteMessage.data["NotificationType"] == "2") {
notification.videoURL = remoteMessage.data["VideoUrl"];
}
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).push(
CustomPageRoute(
page: NotificationDetailsPage(
notification: notification,
),
),
);
// GetNotificationsResponseModel notification = new GetNotificationsResponseModel(); // GetNotificationsResponseModel notification = new GetNotificationsResponseModel();
// //
// notification.createdOn = DateUtil.convertDateToString(DateTime.now()); // notification.createdOn = DateUtil.convertDateToString(DateTime.now());

@ -998,7 +998,10 @@ class AuthenticationViewModel extends ChangeNotifier {
sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er', isFormFamilyFile: isFormFamilyFile); sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er', isFormFamilyFile: isFormFamilyFile);
resultEither.fold( resultEither.fold(
(failure) async => await _errorHandlerService.handleError(failure: failure), (failure) async {
LoaderBottomSheet.hideLoader();
await _errorHandlerService.handleError(failure: failure);
},
(apiResponse) async { (apiResponse) async {
if (isFormFamilyFile) { if (isFormFamilyFile) {
if (apiResponse.data['PatientShareRequestID'] != null && apiResponse.data['PatientShareRequestID'] == 0 && apiResponse.messageStatus == 1) { if (apiResponse.data['PatientShareRequestID'] != null && apiResponse.data['PatientShareRequestID'] == 0 && apiResponse.messageStatus == 1) {

@ -1,11 +1,13 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenshot_blocker/flutter_screenshot_blocker.dart'; import 'package:flutter_screenshot_blocker/flutter_screenshot_blocker.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/notifications/models/resp_models/notification_response_model.dart'; import 'package:hmg_patient_app_new/features/notifications/models/resp_models/notification_response_model.dart';
import 'package:hmg_patient_app_new/features/notifications/notifications_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
@ -21,6 +23,7 @@ class NotificationDetailsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
getIt.get<NotificationsViewModel>().markAsRead(notificationID: notification.id ?? 0);
return ScreenshotBlockerWidget( return ScreenshotBlockerWidget(
blockScreenshots: true, // makes this widget appear black in screenshots blockScreenshots: true, // makes this widget appear black in screenshots
detectScreenshots: true, // listen for screenshot attempts detectScreenshots: true, // listen for screenshot attempts

@ -108,9 +108,7 @@ class _NotificationsListPageState extends State<NotificationsListPage> {
Expanded( Expanded(
child: notificationsVM.notificationsList[index].message!.toText16( child: notificationsVM.notificationsList[index].message!.toText16(
isBold: (notificationsVM.notificationsList[index].isRead == false), isBold: (notificationsVM.notificationsList[index].isRead == false),
weight: (notificationsVM.notificationsList[index].isRead == false) weight: (notificationsVM.notificationsList[index].isRead == false) ? FontWeight.w600 : FontWeight.w400,
? FontWeight.w600
: FontWeight.w400,
), ),
), ),
SizedBox(width: 8.w), SizedBox(width: 8.w),
@ -144,11 +142,7 @@ class _NotificationsListPageState extends State<NotificationsListPage> {
children: [ children: [
Icon(Icons.access_time, size: 12.w, color: AppColors.textColor), Icon(Icons.access_time, size: 12.w, color: AppColors.textColor),
SizedBox(width: 4.w), SizedBox(width: 4.w),
_formatTime(notificationsVM.notificationsList[index].isSentOn).toText10( _formatTime(notificationsVM.notificationsList[index].isSentOn).toText10(weight: FontWeight.w600, color: AppColors.textColor, isEnglishOnly: true),
weight: FontWeight.w600,
color: AppColors.textColor,
isEnglishOnly: true
),
], ],
), ),
), ),
@ -168,11 +162,7 @@ class _NotificationsListPageState extends State<NotificationsListPage> {
children: [ children: [
Icon(Icons.calendar_today, size: 12.w, color: AppColors.textColor), Icon(Icons.calendar_today, size: 12.w, color: AppColors.textColor),
SizedBox(width: 4.w), SizedBox(width: 4.w),
_formatDate(notificationsVM.notificationsList[index].isSentOn).toText10( _formatDate(notificationsVM.notificationsList[index].isSentOn).toText10(weight: FontWeight.w600, color: AppColors.textColor, isEnglishOnly: true),
weight: FontWeight.w600,
color: AppColors.textColor,
isEnglishOnly: true
),
], ],
), ),
), ),
@ -191,8 +181,7 @@ class _NotificationsListPageState extends State<NotificationsListPage> {
], ],
), ),
// Second row: Contains Image chip (if MessageType is "image") // Second row: Contains Image chip (if MessageType is "image")
if (notificationsVM.notificationsList[index].messageType != null && if (notificationsVM.notificationsList[index].messageType != null && notificationsVM.notificationsList[index].messageType!.toLowerCase() == "image")
notificationsVM.notificationsList[index].messageType!.toLowerCase() == "image")
Padding( Padding(
padding: EdgeInsets.only(top: 8.h), padding: EdgeInsets.only(top: 8.h),
child: Row( child: Row(

Loading…
Cancel
Save