首页 > 解决方案 > I’m creating a birthday reminder app in flutter, I’ve done everything except setting schedule notification on the specific date of birth Enter by user

问题描述

I’ve implemented these things

  1. Databas.
  2. showing the records in list view
  3. There’s a add button to add user name, date of birth
  4. Local notification as well

Problem is ,how to setup notification reminder on the specific date enter by the user so that the app remind me the birthday of the person

标签: flutterscheduledart-pubremindersflutter-notification

解决方案


我认为你应该尝试以下简单的依赖。 https://pub.dev/packages/awesome_notifications

  String localTimeZone = await AwesomeNotifications().getLocalTimeZoneIdentifier();
  String utcTimeZone = await AwesomeNotifications().getLocalTimeZoneIdentifier();
  
  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: /*Your Interval in Seconds (60)*/, timeZone: localTimeZone, repeats: true));

推荐阅读