【问题标题】: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我正在用flutter创建一个生日提醒应用程序,除了在特定出生日期设置日程通知外,我已经完成了所有工作 由用户输入
【发布时间】:2021-10-19 21:42:42
【问题描述】:

我已经实现了这些东西

  1. 数据库。
  2. 在列表视图中显示记录
  3. 有一个添加按钮可以添加用户名、出生日期
  4. 还有本地通知

问题是,如何在用户输入的特定日期设置通知提醒,以便应用提醒我此人的生日

【问题讨论】:

  • 请帮我完成这项任务

标签: flutter schedule dart-pub reminders flutter-notification


【解决方案1】:

我认为您应该尝试以下简单依赖项。 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));

【讨论】:

  • 先生,您能给我推荐任何关于这个问题的教程吗?我试过但没有实现。
  • @FaridGem 请检查下面的存储库github.com/sentanilesh/schedule_notification_fluttrer
  • 先生,我知道如何在特定时间安排通知,就像您在应用程序中所做的那样,10 秒后显示通知,但我的问题是如何设置生日提醒。假设我输入我的出生日期 2002 年 8 月 9 日,明天 2021 年 9 月 9 日它提醒我今天是你的生日。
  • @FaridGem 在这种情况下您可以手动添加时差并安排通知请查看github.com/sentanilesh/schedule_notification_fluttrer/commit/…
  • 谢谢您,先生!但我仍然坚持下去,因为我没有收到任何关于我手动输入的当前日期的通知。请帮我。 +923345850933 在 WhatsApp 上
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-12-19
  • 1970-01-01
  • 1970-01-01
  • 2011-05-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多