schedule method
- @Deprecated('Deprecated due to problems with time zones. Use zonedSchedule instead.')
- int id,
- String? title,
- String? body,
- DateTime scheduledDate,
- AndroidNotificationDetails? notificationDetails, {
- String? payload,
- AndroidScheduleMode scheduleMode = AndroidScheduleMode.exact,
Schedules a notification to be shown at the specified date and time.
The scheduleMode
parameter defines the precision of the timing for the
notification to be appear.
Implementation
@Deprecated(
'Deprecated due to problems with time zones. Use zonedSchedule instead.')
Future<void> schedule(
int id,
String? title,
String? body,
DateTime scheduledDate,
AndroidNotificationDetails? notificationDetails, {
String? payload,
AndroidScheduleMode scheduleMode = AndroidScheduleMode.exact,
}) async {
validateId(id);
await _channel.invokeMethod('schedule', <String, Object?>{
'id': id,
'title': title,
'body': body,
'millisecondsSinceEpoch': scheduledDate.millisecondsSinceEpoch,
'platformSpecifics':
_buildPlatformSpecifics(notificationDetails, scheduleMode),
'payload': payload ?? ''
});
}