我正在使用一个很棒的包,并试图在特定时间使用这个包发出通知。
Future<void> showNotificationWithIconsAndActionButtons(int id) async {
AwesomeNotifications().initialize(
'',
[
NotificationChannel(
channelKey: 'basic_channel',
channelName: 'Basic notifications',
channelDescription: 'Notification channel for basic tests',
defaultColor: Color(0xFF9D50DD),
ledColor: Colors.white,
playSound: true,
importance: NotificationImportance.Max,
defaultRingtoneType: DefaultRingtoneType.Notification,
)
]
);
await AwesomeNotifications().createNotification(
content: NotificationContent(
id: id,
channelKey: 'basic_channel',
title: 'Anonymous says:',
body: 'Hi there!',
payload: {'uuid': 'user-profile-uuid'},
displayOnBackground: true,
displayOnForeground: true,
),
我需要在特定时间发出通知。