Flutter Local Notifications show notification every 28 days

Viewed 39

I'm trying to make a patterned notification by using flutter local notification.

I want my cycle to be 28 days as default and when the user sets a certain number of days, notification alerts for X days and none for 28 - X days.

When a cycle ends, it automatically restarts from day 1 of 28. I'm curious to know if this is possible, how I can make this work.

1 Answers

Try using Awesome Notifications. This plugin supports periodic notifications and many other interesting features: pictures, buttons, sounds, Firebase integration and more

await AwesomeNotifications().createNotification(
  content: NotificationContent(
      id: id,
      channelKey: 'scheduled',
      title: 'Notification at every single minute',
      body:
          'This notification was schedule to repeat at every single minute.',
      notificationLayout: NotificationLayout.BigPicture,
      bigPicture: 'asset://assets/images/melted-clock.png',
  ),
  schedule: NotificationInterval(
    interval: 60, 
    timeZone: localTimeZone, 
    repeats: true,
  ),
);
Related