showSyncProgressNotification static method
Exibe uma notificação de progresso da sincronização
Implementation
static Future<void> showSyncProgressNotification({
required String title,
required String body,
int? progress,
int? maxProgress,
bool indeterminate = false,
}) async {
try {
final syncConfig = _getSyncConfig();
if (syncConfig == null || !syncConfig.enableNotifications) {
return;
}
if (indeterminate || (progress == null || maxProgress == null)) {
await SyncNotificationService.instance.showNotification(
title: title,
message: body,
notificationId: SyncConstants.progressNotificationId,
);
} else {
await SyncNotificationService.instance.showProgressNotification(
title: title,
message: body,
progress: progress,
maxProgress: maxProgress,
notificationId: SyncConstants.progressNotificationId,
);
}
} catch (e) {
SyncUtils.debugLog('Erro ao exibir notificação de progresso: $e', tag: 'BackgroundSyncService');
}
}