showWeeklyAtDayAndTime method

  1. @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(
  1. int id,
  2. String? title,
  3. String? body,
  4. Day day,
  5. Time notificationTime,
  6. NotificationDetails notificationDetails, {
  7. String? payload,
})

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();
  }
}