repository_kit library

A pure Dart toolkit for implementing clean, offline-first repositories.

Eliminates repetitive data-layer boilerplate by owning cache-vs-remote strategy decisions inside the repository. The presentation layer simply consumes a stream of RKitState events.

Classes

RKitCache<T>
Stale data from local storage is available while fresh data is being fetched.
RKitCachePolicy
Controls when RKitRepository.watch performs a remote fetch.
RKitFailure<T>
The operation failed. Stale data is preserved when a local cache existed.
RKitLoading<T>
The repository has started loading. No data is available yet.
RKitRepository<ResultType, RemoteType>
Mixin class for implementing offline-first repositories.
RKitRetryPolicy
Controls how RKitRepository.watch handles remote request failures.
RKitState<T>
Represents the state of a repository operation.
RKitSuccess<T>
Fresh data was successfully fetched from the remote source and persisted.

Exceptions / Errors

RKitException
Base class for exceptions thrown by the RKitRepository framework itself.