showLocalNotificationAfterSeconds method

Future<void> showLocalNotificationAfterSeconds({
  1. required int seconds,
  2. required int id,
  3. required String title,
  4. required String body,
  5. required String payload,
})

Implementation

Future<void> showLocalNotificationAfterSeconds({
  required int seconds,
  required int id,
  required String title,
  required String body,
  required String payload,
}) async {
  final platformChannelSpecifics = await _notificationDetails();
  await _localNotifications.zonedSchedule(
      id,
      title,
      body,
      tz.TZDateTime.now(tz.local).add(Duration(seconds: seconds)),
      platformChannelSpecifics,
      uiLocalNotificationDateInterpretation:
          UILocalNotificationDateInterpretation.absoluteTime,
      androidScheduleMode: AndroidScheduleMode.inexactAllowWhileIdle);
}