Skip to content

Commit 61d98d0

Browse files
committed
feat: Sesuaikan notifikasi screenshot agar play sound-nya disesuaikan dengan pengaturannya
1 parent 408e67b commit 61d98d0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/core/util/notification_helper.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'package:dipantau_desktop_client/core/util/enum/global_variable.dart';
2+
import 'package:dipantau_desktop_client/core/util/shared_preferences_manager.dart';
13
import 'package:easy_localization/easy_localization.dart';
24
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
35

@@ -18,14 +20,19 @@ class NotificationHelper {
1820
}
1921

2022
void showScreenshotTakenNotification() {
23+
final presentSound = sharedPreferencesManager.getBool(
24+
SharedPreferencesManager.keyIsEnableSoundScreenshotNotification,
25+
defaultValue: true,
26+
) ??
27+
true;
2128
localNotification?.show(
2229
DateTime.now().millisecond,
2330
'app_name'.tr(),
2431
'screenshot_taken'.tr(),
25-
const NotificationDetails(
32+
NotificationDetails(
2633
macOS: DarwinNotificationDetails(
2734
presentAlert: true,
28-
presentSound: true,
35+
presentSound: presentSound,
2936
),
3037
),
3138
);

0 commit comments

Comments
 (0)