fix: formatting

This commit is contained in:
2026-07-29 01:42:34 +02:00
parent 521c8f8c4e
commit 50e6fca9d1
32 changed files with 501 additions and 575 deletions
+11 -17
View File
@@ -24,8 +24,11 @@ class SettingsViewModel extends ChangeNotifier {
bool get checkingForUpdates => _checkingForUpdates;
AppSettings get settings => _settings;
bool get isLoading => _isLoading;
bool get hasLoaded => _hasLoaded;
String? get errorMessage => _errorMessage;
Future<void> ensureLoaded() async {
@@ -66,10 +69,9 @@ class SettingsViewModel extends ChangeNotifier {
}
Future<void> installUpdate(
UpdateInfo update, {
void Function(double progress)? onProgress,
}) async {
UpdateInfo update, {
void Function(double progress)? onProgress,
}) async {
final url = update.download.startsWith("http")
? update.download
: "https://updater.brammie15.dev${update.download}";
@@ -83,28 +85,20 @@ class SettingsViewModel extends ChangeNotifier {
);
await for (final event in stream) {
debugPrint(
"OTA: ${event.status} ${event.value}",
);
debugPrint("OTA: ${event.status} ${event.value}");
if (event.status == OtaStatus.DOWNLOADING) {
final progress =
double.tryParse(event.value ?? "0") ?? 0;
final progress = double.tryParse(event.value ?? "0") ?? 0;
onProgress?.call(progress / 100);
}
if (event.status == OtaStatus.DOWNLOAD_ERROR) {
throw Exception(
"Download failed: ${event.value}",
);
throw Exception("Download failed: ${event.value}");
}
if (event.status == OtaStatus.INSTALLATION_ERROR) {
throw Exception(
"Installation failed: ${event.value}",
);
throw Exception("Installation failed: ${event.value}");
}
}
}
@@ -131,4 +125,4 @@ class SettingsViewModel extends ChangeNotifier {
notifyListeners();
}
}
}
}