flutter_offline_sync_core library

Classes

$$SyncJobsTableAnnotationComposer
$$SyncJobsTableFilterComposer
$$SyncJobsTableOrderingComposer
$$SyncJobsTableReferences
$$SyncJobsTableTableManager
$$SyncStepsTableAnnotationComposer
$$SyncStepsTableFilterComposer
$$SyncStepsTableOrderingComposer
$$SyncStepsTableReferences
$$SyncStepsTableTableManager
$SyncDatabaseManager
$SyncJobsTable
$SyncStepsTable
CrossJobDependency
Declares that a step in this job must wait for another job's step to succeed before it can run, and copies configured fields from that step's API output into this step's input.
FieldMapping
Maps one field from an upstream step's output into a downstream step's input.
JobBuilder
Builds a job with one or more dependent steps, then persists it in a single transaction. Example:
RetryPolicy
Exponential backoff with a cap and jitter, so a step that keeps failing (e.g. no connectivity) doesn't hammer the server on every sync trigger, and so many steps/devices retrying around the same moment (e.g. right after connectivity returns for everyone at once) don't all land on the exact same retry instant.
SyncContext
Data made available to a handler when its step runs: the step's own static input, plus outputs of every step it depends on (already resolved by the engine before execute() is called).
SyncDatabase
SyncEngine
Orchestrates execution of a job's step DAG: resolves dependency order, runs ready steps, persists outputs, and stops at the first failed or conflicted step without touching its unresolved downstream siblings.
SyncHandlerRegistry
Simple in-memory registry mapping taskType -> handler. Register your handlers once at app startup (and again inside the background isolate entrypoint, since it has no shared state with the foreground app).
SyncJob
SyncJobsCompanion
SyncStep
SyncStepConflict
SyncStepFailure
SyncStepResult
Outcome of a single handler execution.
SyncStepsCompanion
SyncStepSuccess
SyncTaskHandler
Implement one of these per distinct API operation and register it by taskType key. The engine never inspects HTTP details directly -- it only calls execute() and stores whatever comes back.

Functions

openConnection({String? dbPath}) → LazyDatabase
Opens the sync database at a stable path shared by the foreground app isolate and the background WorkManager isolate. WAL mode is required: under the default rollback-journal mode, two isolates/processes with independent connections to the same file will lock each other out. WAL supports concurrent readers + a single writer safely.
parseCrossJobDependencies(String? json) → List<CrossJobDependency>

Typedefs

$$SyncJobsTableCreateCompanionBuilder = SyncJobsCompanion Function({Value<DateTime> createdAt, required String feature, Value<int> id, required String idempotencyKey, Value<String?> meta, required String screen, required JobStatus status, Value<DateTime> updatedAt})
$$SyncJobsTableProcessedTableManager = ProcessedTableManager<_$SyncDatabase, $SyncJobsTable, SyncJob, $$SyncJobsTableFilterComposer, $$SyncJobsTableOrderingComposer, $$SyncJobsTableAnnotationComposer, $$SyncJobsTableCreateCompanionBuilder, $$SyncJobsTableUpdateCompanionBuilder, (SyncJob, $$SyncJobsTableReferences), SyncJob, PrefetchHooks Function({bool syncStepsRefs})>
$$SyncJobsTableUpdateCompanionBuilder = SyncJobsCompanion Function({Value<DateTime> createdAt, Value<String> feature, Value<int> id, Value<String> idempotencyKey, Value<String?> meta, Value<String> screen, Value<JobStatus> status, Value<DateTime> updatedAt})
$$SyncStepsTableCreateCompanionBuilder = SyncStepsCompanion Function({Value<int> attempt, Value<DateTime?> completedAt, Value<String?> conflictData, Value<String> dependsOn, Value<String> externalDependsOn, Value<int> id, required String input, required int jobId, Value<String?> lastError, Value<DateTime?> nextRetryAt, Value<String?> output, Value<int> sortIndex, required StepStatus status, required String stepKey, required String taskType})
$$SyncStepsTableProcessedTableManager = ProcessedTableManager<_$SyncDatabase, $SyncStepsTable, SyncStep, $$SyncStepsTableFilterComposer, $$SyncStepsTableOrderingComposer, $$SyncStepsTableAnnotationComposer, $$SyncStepsTableCreateCompanionBuilder, $$SyncStepsTableUpdateCompanionBuilder, (SyncStep, $$SyncStepsTableReferences), SyncStep, PrefetchHooks Function({bool jobId})>
$$SyncStepsTableUpdateCompanionBuilder = SyncStepsCompanion Function({Value<int> attempt, Value<DateTime?> completedAt, Value<String?> conflictData, Value<String> dependsOn, Value<String> externalDependsOn, Value<int> id, Value<String> input, Value<int> jobId, Value<String?> lastError, Value<DateTime?> nextRetryAt, Value<String?> output, Value<int> sortIndex, Value<StepStatus> status, Value<String> stepKey, Value<String> taskType})