【发布时间】:2021-10-19 21:42:42
【问题描述】:
我已经实现了这些东西
- 数据库。
- 在列表视图中显示记录
- 有一个添加按钮可以添加用户名、出生日期
- 还有本地通知
问题是,如何在用户输入的特定日期设置通知提醒,以便应用提醒我此人的生日
【问题讨论】:
-
请帮我完成这项任务
标签: flutter schedule dart-pub reminders flutter-notification
我已经实现了这些东西
问题是,如何在用户输入的特定日期设置通知提醒,以便应用提醒我此人的生日
【问题讨论】:
标签: flutter schedule dart-pub reminders flutter-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));
【讨论】: