rya*_*rya 8 localnotification dart flutter
我正在使用flutter_local_notifications库每 1 小时安排一次本地通知。它正在按预期工作,但现在,我需要一种方法来启动/停止通知计划(例如,按下按钮)。
我在文档中找不到有关取消预定通知请求的任何内容。
Aun*_*Man 14
取消/删除通知
// cancel the notification with id value of zero
await flutterLocalNotificationsPlugin.cancel(0);
// 0 is your notification id
Run Code Online (Sandbox Code Playgroud)
取消/删除所有通知
await flutterLocalNotificationsPlugin.cancelAll();
Run Code Online (Sandbox Code Playgroud)
是的,这可以取消当前和未来的通知。只需确保正确的通知 ID 即可。
| 归档时间: |
|
| 查看次数: |
8518 次 |
| 最近记录: |