showDownloadProgress method

Future<void> showDownloadProgress(
  1. int maxProgress,
  2. int progress,
  3. String versionName
)

Implementation

Future<void> showDownloadProgress(int maxProgress, int progress, String versionName) async {
  var androidDetails = AndroidNotificationDetails(
    'UpdateCenter',
    'Update Center',
    subText: versionName,
    channelShowBadge: config.notificationConfig.channelShowBadge,
    importance: Importance.high,
    priority: Priority.high,
    onlyAlertOnce: true,
    showProgress: config.notificationConfig.showProgress,
    maxProgress: maxProgress,
    progress: progress,
  );
  await showNotification(
    id: downloadNotificationId,
    title: config.notificationConfig.downloadProgressNotificationTextTitle,
    body: config.notificationConfig.downloadProgressNotificationTextBody,
    details: NotificationDetails(android: androidDetails),
  );
}