scheduleNotification method
Schedule a notification to be shown by the operating system at a fixed time, even when the app is fully closed (a real background service).
This uses the platform's native scheduling APIs (Android AlarmManager,
iOS/macOS UNUserNotificationCenter calendar triggers, Windows
scheduled toasts, Linux detached timer) so no external plugin is
required.
idmust be unique; use it later to cancel the notification.scheduledEpochMillisis the delivery time as milliseconds since epoch.alarmSoundplays a louder, alarm-like sound (high importance channel).
Returns true when the notification was scheduled.
Implementation
Future<bool> scheduleNotification({
required int id,
required String title,
required String message,
required DateTime scheduledTime,
String? channelId,
NotificationImportance? importance,
bool alarmSound = false,
String? targetScreen,
Map<String, dynamic>? extraData,
}) {
return NotificationMasterPlatform.instance.scheduleNotification(
id: id,
title: title,
message: message,
scheduledEpochMillis: scheduledTime.millisecondsSinceEpoch,
channelId: channelId,
importance: importance,
alarmSound: alarmSound,
targetScreen: targetScreen,
extraData: extraData,
);
}