RepositorySaveOperations<T extends SynquillDataModel<T> > mixin
Mixin providing save operations for repositories.
- Superclass constraints
- Mixin applications
Properties
-
apiAdapter
→ ApiAdapterBase<
T> -
Gets the API adapter for this repository.
no setter
-
changeController
→ StreamController<
RepositoryChange< T> > -
The stream controller for repository change events.
no setter
- defaultSavePolicy → DataSavePolicy
-
Gets the default save policy from global configuration.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- localOnly → bool
-
Whether this repository is local-only (no remote sync).
no setterinherited
- log → Logger
-
Logger for the repository - must be implemented by concrete classes
no setterinherited
- queueManager → RequestQueueManager
-
The queue manager for handling API operations.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
fetchAllFromLocal(
{QueryParams? queryParams}) → Future< List< T> > -
Fetches all items from the local database.
inherited
-
fetchAllFromLocalWithoutPendingSyncOps(
{QueryParams? queryParams}) → Future< List< T> > -
Fetches all items from the local database, excluding those
with pending sync operations.
inherited
-
fetchAllFromRemote(
{QueryParams? queryParams, Map< String, dynamic> ? extra, Map<String, String> ? headers}) → Future<List< T> > -
Fetches all items from the remote API.
inherited
-
fetchFromLocal(
String id, {QueryParams? queryParams}) → Future< T?> -
Fetches an item from the local database.
inherited
-
fetchFromRemote(
String id, {QueryParams? queryParams, Map< String, dynamic> ? extra, Map<String, String> ? headers}) → Future<T?> -
Fetches an item from the remote API.
inherited
-
isExistingItem(
T item) → Future< bool> -
Checks if an item with the given ID exists in the local database.
This is a placeholder and should be overridden by concrete repositories.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeFromLocalIfExists(
String id) → Future< void> -
Removes an item from the local database if it exists.
inherited
-
save(
T item, {DataSavePolicy? savePolicy, Map< String, dynamic> ? extra, Map<String, String> ? headers, bool updateTimestamps = true}) → Future<T> - Saves an item.
-
saveToLocal(
T item, {Map< String, dynamic> ? extra}) → Future<void> -
Saves an item to the local database.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
truncateLocalStorage(
) → Future< void> -
Truncates (clears) all local storage for this model type.
inherited
-
updateLocalCache(
List< T> items) → Future<void> -
Updates the local cache with remote data.
inherited
-
watchAllFromLocal(
{QueryParams? queryParams}) → Stream< List< T> > -
Watches all items from the local database.
inherited
-
watchFromLocal(
String id, {QueryParams? queryParams}) → Stream< T?> -
Watches a single item from the local database by its ID.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited