showWeeklyAtDayAndTime method
- @Deprecated('Deprecated due to problems with time zones. Use zonedSchedule instead ' 'by passing a date in the future with the same day of the week and time ' 'as well as passing DateTimeComponents.dayOfWeekAndTime as the value of ' 'the matchDateTimeComponents parameter.')
Shows a notification on weekly interval at the specified day and time.
Implementation
@Deprecated(
'Deprecated due to problems with time zones. Use zonedSchedule instead '
'by passing a date in the future with the same day of the week and time '
'as well as passing DateTimeComponents.dayOfWeekAndTime as the value of '
'the matchDateTimeComponents parameter.')
Future<void> showWeeklyAtDayAndTime(
int id,
String? title,
String? body,
Day day,
Time notificationTime,
NotificationDetails notificationDetails, {
String? payload,
}) async {
if (kIsWeb) {
return;
}
if (defaultTargetPlatform == TargetPlatform.android) {
await resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.showWeeklyAtDayAndTime(id, title, body, day, notificationTime,
notificationDetails.android,
payload: payload);
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
await resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.showWeeklyAtDayAndTime(
id, title, body, day, notificationTime, notificationDetails.iOS,
payload: payload);
} else if (defaultTargetPlatform == TargetPlatform.macOS) {
throw UnimplementedError();
}
}