chore: drop parseMacRecoveryProgress

This commit is contained in:
Martin Wimpress 2024-06-26 15:53:37 +01:00 committed by Martin Wimpress
parent f0f02030cc
commit 9d596b6acc
1 changed files with 0 additions and 16 deletions

View File

@ -32,7 +32,6 @@ class Downloader extends StatefulWidget {
class _DownloaderState extends State<Downloader> {
final notificationsClient = NotificationsClient();
final wgetPattern = RegExp("( [0-9.]+%)");
final macRecoveryPattern = RegExp("([0-9]+\\.[0-9])");
final ariaPattern = RegExp("([0-9.]+%)");
late final Stream<double> _progressStream;
bool _downloadFinished = false;
@ -67,17 +66,6 @@ class _DownloaderState extends State<Downloader> {
}
}
void parseMacRecoveryProgress(String line) {
var matches = macRecoveryPattern.allMatches(line).toList();
if (matches.isNotEmpty) {
var size = matches[0].group(1);
if (size != null) {
var value = double.parse(size);
controller.add(value);
}
}
}
Stream<double> progressStream() {
var options = [widget.operatingSystem.code, widget.version.version];
if (widget.option != null) {
@ -88,10 +76,6 @@ class _DownloaderState extends State<Downloader> {
process.stderr.transform(utf8.decoder).forEach(parseWgetProgress);
} else if (widget.option!.downloader == 'zsync') {
controller.add(-1);
} else if (widget.option!.downloader == 'macrecovery') {
process.stdout
.transform(utf8.decoder)
.forEach(parseMacRecoveryProgress);
} else if (widget.option!.downloader == 'aria2c') {
process.stderr.transform(utf8.decoder).forEach(parseAriaProgress);
}