0

i want to repeate my functionn every day at time of each prayer my code sent notification successfully but sent it just one time and what i want sending this notification every day since user avtivate it

here is my function code :

 void scheduleNotification(int id) async {
    DateTime now = DateTime.now();
    List<int> timeParts = prayerTimes[id].split(':').map(int.parse).toList();
    String localTimeZone =
        await AwesomeNotifications().getLocalTimeZoneIdentifier();

    DateTime scheduledDate =
        DateTime(now.year, now.month, now.day, timeParts[0], timeParts[1]);

    AwesomeNotifications().createNotification(
      content: NotificationContent(
        id: id,
        channelKey: 'basic key',
        title: 'Prayer Time Notification${Emojis.clothing_prayer_beads}',
        body: 'It\'s time for prayer!',
        bigPicture: 'asset://assets/adhan.png',
        notificationLayout: NotificationLayout.BigPicture,
        wakeUpScreen: true,
        locked: true,
        autoDismissible: false,
      ),
      schedule: NotificationCalendar.fromDate(
        date: scheduledDate,
        repeats: true,
        preciseAlarm: true,
        allowWhileIdle: true,
      ),
    );
  }

0 Answers0