style: add flow-control braces to sync manager

This commit is contained in:
bponders12-cell 2026-09-01 17:34:20 -04:00
parent 067205bb0c
commit 4402f1b272
1 changed files with 8 additions and 2 deletions

View File

@ -13,7 +13,11 @@ class SyncManager extends ChangeNotifier {
DateTime? Function() _nowProvider; DateTime? Function() _nowProvider;
SyncManager(this._outbox, {List<SyncProvider>? initialProviders, String? defaultProviderId, DateTime? Function()? nowProvider}) : _nowProvider = nowProvider ?? (() => DateTime.now()) { SyncManager(this._outbox, {List<SyncProvider>? initialProviders, String? defaultProviderId, DateTime? Function()? nowProvider}) : _nowProvider = nowProvider ?? (() => DateTime.now()) {
if (initialProviders != null) for (final p in initialProviders) registerProvider(p); if (initialProviders != null) {
for (final p in initialProviders) {
registerProvider(p);
}
}
if (defaultProviderId != null) _activeProviderId = defaultProviderId; if (defaultProviderId != null) _activeProviderId = defaultProviderId;
} }
@ -37,7 +41,9 @@ class SyncManager extends ChangeNotifier {
} else if (item.status == SyncStatus.failed || item.status == SyncStatus.cancelled) { } else if (item.status == SyncStatus.failed || item.status == SyncStatus.cancelled) {
failed++; failed++;
if (item.lastError != null) lastErr = item.lastError; if (item.lastError != null) lastErr = item.lastError;
} else { pending++; } } else {
pending++;
}
} }
return SyncManagerState(isProcessing: _isProcessing, pendingCount: pending, syncedCount: synced, failedCount: failed, lastSuccessfulSync: lastSuccess, lastError: lastErr, activeProviderId: _activeProviderId); return SyncManagerState(isProcessing: _isProcessing, pendingCount: pending, syncedCount: synced, failedCount: failed, lastSuccessfulSync: lastSuccess, lastError: lastErr, activeProviderId: _activeProviderId);
} }