|
|
|
@ -1,5 +1,6 @@
|
|
|
|
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: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';
|
|
|
|
@ -20,7 +21,16 @@ class NotificationDetailsPage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return CollapsingListView(
|
|
|
|
return ScreenshotBlockerWidget(
|
|
|
|
|
|
|
|
blockScreenshots: true, // makes this widget appear black in screenshots
|
|
|
|
|
|
|
|
detectScreenshots: true, // listen for screenshot attempts
|
|
|
|
|
|
|
|
onScreenshotDetected: (event) {
|
|
|
|
|
|
|
|
// event.type → 'screenshot_taken' or 'screenshot_blocked'
|
|
|
|
|
|
|
|
// ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
|
|
|
|
// SnackBar(content: Text('Screenshots are not allowed!')),
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: CollapsingListView(
|
|
|
|
title: LocaleKeys.notificationDetails.tr(),
|
|
|
|
title: LocaleKeys.notificationDetails.tr(),
|
|
|
|
// trailing: IconButton(
|
|
|
|
// trailing: IconButton(
|
|
|
|
// icon: Icon(
|
|
|
|
// icon: Icon(
|
|
|
|
@ -43,6 +53,7 @@ class NotificationDetailsPage extends StatelessWidget {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).paddingSymmetrical(24.w, 0.h),
|
|
|
|
).paddingSymmetrical(24.w, 0.h),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -123,8 +134,7 @@ class NotificationDetailsPage extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
// Notification image (if MessageType is "image")
|
|
|
|
// Notification image (if MessageType is "image")
|
|
|
|
if (notification.messageType != null &&
|
|
|
|
if (notification.messageType != null && notification.messageType!.toLowerCase() == "image")
|
|
|
|
notification.messageType!.toLowerCase() == "image")
|
|
|
|
|
|
|
|
Builder(
|
|
|
|
Builder(
|
|
|
|
builder: (context) {
|
|
|
|
builder: (context) {
|
|
|
|
// Try to get image URL from videoURL or messageTypeData
|
|
|
|
// Try to get image URL from videoURL or messageTypeData
|
|
|
|
@ -205,10 +215,7 @@ class NotificationDetailsPage extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: CircularProgressIndicator(
|
|
|
|
child: CircularProgressIndicator(
|
|
|
|
value: loadingProgress.expectedTotalBytes != null
|
|
|
|
value: loadingProgress.expectedTotalBytes != null ? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes! : null,
|
|
|
|
? loadingProgress.cumulativeBytesLoaded /
|
|
|
|
|
|
|
|
loadingProgress.expectedTotalBytes!
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -249,7 +256,8 @@ ${notification.message ?? 'Notification'}
|
|
|
|
Time: ${_formatTime(notification.isSentOn)}
|
|
|
|
Time: ${_formatTime(notification.isSentOn)}
|
|
|
|
Date: ${_formatDate(notification.isSentOn)}
|
|
|
|
Date: ${_formatDate(notification.isSentOn)}
|
|
|
|
${notification.notificationType != null ? '\nType: ${notification.notificationType}' : ''}
|
|
|
|
${notification.notificationType != null ? '\nType: ${notification.notificationType}' : ''}
|
|
|
|
'''.trim();
|
|
|
|
'''
|
|
|
|
|
|
|
|
.trim();
|
|
|
|
|
|
|
|
|
|
|
|
await Share.share(shareText);
|
|
|
|
await Share.share(shareText);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -274,4 +282,3 @@ ${notification.notificationType != null ? '\nType: ${notification.notificationTy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|