Fladder/lib/providers/sync/background_download_provider.dart
PartyDonut 7b3e733b76
[Setup] Added build.yaml and check.yaml (#1)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
2024-09-21 11:59:28 +02:00

16 lines
610 B
Dart

import 'package:background_downloader/background_downloader.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'background_download_provider.g.dart';
@Riverpod(keepAlive: true)
FileDownloader backgroundDownloader(BackgroundDownloaderRef ref) {
return FileDownloader()
..trackTasks()
..configureNotification(
running: const TaskNotification('Downloading', 'file: {filename}'),
complete: const TaskNotification('Download finished', 'file: {filename}'),
paused: const TaskNotification('Download paused', 'file: {filename}'),
progressBar: true,
);
}