zonedSchedule method
Future<void>
zonedSchedule({
- required int id,
- String? title,
- String? body,
- required TZDateTime scheduledDate,
- String? payload,
- DateTimeComponents? matchDateTimeComponents,
- DarwinNotificationDetails? notificationDetails,
override
Schedules a notification to be shown at the specified time in the future in a specific time zone.
Implementation
@override
Future<void> zonedSchedule({
required int id,
String? title,
String? body,
required tz.TZDateTime scheduledDate,
String? payload,
DateTimeComponents? matchDateTimeComponents,
DarwinNotificationDetails? notificationDetails,
}) async {
validateId(id);
validateDateIsInTheFuture(scheduledDate, matchDateTimeComponents);
final Map<String, Object?> serializedPlatformSpecifics =
notificationDetails?.toMap() ?? <String, Object>{};
await _channel.invokeMethod(
'zonedSchedule',
<String, Object?>{
'id': id,
'title': title,
'body': body,
'platformSpecifics': serializedPlatformSpecifics,
'payload': payload ?? '',
}
..addAll(scheduledDate.toMap())
..addAll(
matchDateTimeComponents == null
? <String, Object>{}
: <String, Object>{
'matchDateTimeComponents': matchDateTimeComponents.index,
},
),
);
}