mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-16 10:46:00 -07:00
feature: Improved sync capability
This commit is contained in:
parent
f3e920ac79
commit
c5c7f71b84
31 changed files with 500 additions and 344 deletions
|
|
@ -1,7 +1,10 @@
|
|||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'package:background_downloader/background_downloader.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
import 'package:fladder/providers/settings/client_settings_provider.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
|
||||
part 'background_download_provider.g.dart';
|
||||
|
||||
|
|
@ -14,13 +17,7 @@ class BackgroundDownloader extends _$BackgroundDownloader {
|
|||
..configure(
|
||||
globalConfig: globalConfig(maxDownloads),
|
||||
)
|
||||
..trackTasks()
|
||||
..configureNotification(
|
||||
running: const TaskNotification('Downloading', 'file: {filename}'),
|
||||
complete: const TaskNotification('Download finished', 'file: {filename}'),
|
||||
paused: const TaskNotification('Download paused', 'file: {filename}'),
|
||||
progressBar: true,
|
||||
);
|
||||
..trackTasks();
|
||||
}
|
||||
|
||||
void setMaxConcurrent(int value) {
|
||||
|
|
@ -29,6 +26,16 @@ class BackgroundDownloader extends _$BackgroundDownloader {
|
|||
);
|
||||
}
|
||||
|
||||
void updateTranslations(BuildContext context) async {
|
||||
state.configureNotification(
|
||||
running: TaskNotification(context.localized.notificationDownloadingDownloading, '{filename}\n{networkSpeed}'),
|
||||
complete: TaskNotification(context.localized.notificationDownloadingFinished, '{filename}'),
|
||||
paused: TaskNotification(context.localized.notificationDownloadingPaused, '{filename}'),
|
||||
error: TaskNotification(context.localized.notificationDownloadingError, '{filename}'),
|
||||
progressBar: true,
|
||||
);
|
||||
}
|
||||
|
||||
(String, dynamic) globalConfig(int value) => value == 0
|
||||
? ("", "")
|
||||
: (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue