Files
noo/lib/models/sync_status.dart
ayushyaandClaude Sonnet 5 ff5f04e9a1
Build APK / build (push) Successful in 5m20s
Dedupe native transfer/notification code and split ServerProvider into focused controllers
Consolidates duplicated GET/PUT/notification-channel logic across
DownloadService/ShareUploadService/SyncEngine into shared Kotlin helpers,
gives upload/download real batch queueing instead of dropping a second
concurrent batch, and dedupes repeated Dart channel-argument boilerplate.

Replaces the 2300+ line ServerProvider god object with ten focused
ChangeNotifiers (SessionController, SettingsController, FilesController,
PhotosController, FavoritesController, TrashController, SharesController,
RecentController, SyncStatusController, PickController) plus ItemOperations,
a plain coordinator for cross-domain item mutations - fixing the coupling
where device-sync status, per-tab data, and global UI prefs all lived in
one object. Updates every view/widget call site accordingly and refreshes
the architecture/server/standards/styling docs to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 10:04:12 -04:00

39 lines
1.2 KiB
Dart

/// A pending device-sync conflict (a file changed both locally and on the
/// server since the last sync) - mirrors `SyncStatusBus.Conflict` on the
/// native side exactly, see `SyncEngine.kt`/`server.md`'s "Device sync"
/// section.
class SyncConflictInfo {
final String accountId;
final String fileId;
final String remotePath;
final String relPath;
final String name;
const SyncConflictInfo({
required this.accountId,
required this.fileId,
required this.remotePath,
required this.relPath,
required this.name,
});
factory SyncConflictInfo.fromMap(Map<dynamic, dynamic> map) {
return SyncConflictInfo(
accountId: map['accountId'] as String? ?? '',
fileId: map['fileId'] as String? ?? '',
remotePath: map['remotePath'] as String? ?? '',
relPath: map['relPath'] as String? ?? '',
name: map['name'] as String? ?? '',
);
}
}
/// A single item's device-sync status, used to badge its tile in the
/// Files view.
enum SyncItemStatus { none, syncing, synced, conflict }
/// The persistent header chip/panel's overall status (account-wide, not
/// scoped to whatever folder is currently browsed) - see
/// `SyncStatusController.syncHeaderStatus`.
enum SyncHeaderStatus { off, syncing, done, alert }