universal_storage_sync library

Universal Storage Sync - A cross-platform Dart package for unified file storage operations

Classes

AuthorInfo
Information about a commit author.
CommitInfo
Information about a version control commit.
FileDiff
Represents changes to a file between two commits.
FileEntry
Represents an entry in a directory listing.
FileOperationResult
Unified result for file operations (create/update/delete).
FileSystemConfig
Configuration for the file system storage provider.
GitHubApiConfig
OfflineGitConfig
StorageConfig
Base class for all storage configurations.
StorageProvider
Provider-agnostic contract for storage operations.
StorageProviderRegistry
Registry for provider factories keyed by StorageConfig type.
StorageService
A service class providing a unified API for file storage operations using a configured StorageProvider.
VcBranch
VcBranchName
VcCreateRepositoryRequest
VcRepository
VcRepositoryName
VcRepositoryOwner
VcRepositorySlug
VcUrl
VersionControlService
WorkingDirectoryStatus
Status of the working directory in version control.

Enums

ConflictResolutionStrategy
Conflict resolution strategies for sync operations.
FileChangeType
Types of changes that can occur to a file.
ProviderType
Enumeration of supported storage provider types.
SyncStatus
Represents the synchronization status between local and remote repositories.

Mixins

AuthenticatedProvider
Mixin providing common authentication functionality for storage providers. Reduces code duplication for authentication checks and token management.
PathNormalizer
Utility class for normalizing file paths across different storage providers. Each provider may have different path requirements and conventions.
RemoteSyncCapable
Mixin for storage providers that support remote synchronization. Provides standardized sync operations and conflict resolution.
RetryableOperation
Utility class for executing operations with retry logic. Provides exponential backoff and custom retry conditions.
StorageFactory
Factory class for creating configured storage services. Automatically determines the provider type based on configuration and returns a ready-to-use StorageService.
VersionControlCapable
Mixin for storage providers that support version control operations. Provides standardized version control functionality like commits, history, and branching.

Extension Types

FileExtension
Extension type that represents a file extension with type safety.
FilePath
Extension type that wraps a file system path string.
FilePathConfig
Extension type that represents the workspace path configuration.
MacOSBookmark
A security-scoped bookmark for a file or directory on macOS.

Functions

fileNormalizedSha256Hex(StorageService storage, String path) Future<String>
Read a file via storage and return normalized SHA-256 hex. Returns empty string if file doesn't exist.
normalizeContent(String input) String
Normalize content by trimming trailing whitespace and collapsing CRLF.
normalizedSha256Hex(String input) String
Compute normalized SHA-256 (hex) for string content.
sha256Hex(String input) String
Lightweight hashing helpers for sync workflows. Pure functions suitable for extraction into a shared utils package. Compute SHA-256 hash (hex) for a string.

Exceptions / Errors

AuthenticationException
Authentication-related error.
AuthenticationFailedException
ConfigurationException
FileAlreadyExistsException
File exists error.
FileNotFoundException
File not found error.
GitConflictException
Git conflict error.
GitHubApiException
GitHub API specific exceptions
GitHubRateLimitException
MergeConflictException
NetworkException
Network error.
NetworkTimeoutException
RemoteAccessDeniedException
RemoteNotFoundException
Remote operation exceptions
RepositoryCreationException
StorageException
Base exception for all storage-related errors.
SyncConflictException
Sync conflict error.
UnsupportedOperationException
Operation not supported error.