showProgressNotification static method

Future<void> showProgressNotification({
  1. required int notificationID,
  2. required String title,
  3. required double progress,
})

Implementation

static Future<void> showProgressNotification({
  required int notificationID,
  required String title,
  required double progress,
}) async {
  await AwesomeNotifications().createNotification(
    content: NotificationContent(
      id: notificationID,
      channelKey: 'download_channel',

      title: title,
      body: 'Progress: ${(progress * 100).toStringAsFixed(1)}%',
      progress: progress,
      notificationLayout: NotificationLayout.ProgressBar,
    ),
  );
}