# Sync progress

Canonical page: https://docs.ovok.com/flutter-sdk/reference/ovok_flutter/sync-progress

{/* Generated by scripts/generate_reference.dart; do not edit. */}

## SyncPauseReason [#syncpausereason]

```dart
enum SyncPauseReason
```

Why a sync run is paused.

### Values [#values]

#### SyncPauseReason.offline [#syncpausereasonoffline]

```dart
static const SyncPauseReason offline
```

The device has no network connection.

#### SyncPauseReason.wifiOnly [#syncpausereasonwifionly]

```dart
static const SyncPauseReason wifiOnly
```

Sync is waiting for an unmetered connection.


## SyncProgress [#syncprogress]

```dart
class SyncProgress
```

Sync state for one data type.

### Constructors [#constructors]

#### SyncProgress.new [#syncprogressnew]

```dart
SyncProgress({
  required String measurementTypeKey,
  required SyncProgressStatus status,
  SyncPauseReason? reason,
  SyncProgressCounts? progress,
})
```

Creates a sync progress snapshot.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `measurementTypeKey` | `String` | required named |  |
| `status` | `SyncProgressStatus` | required named |  |
| `reason` | `SyncPauseReason?` | named |  |
| `progress` | `SyncProgressCounts?` | named |  |

### Properties [#properties]

#### SyncProgress.measurementTypeKey [#syncprogressmeasurementtypekey]

```dart
final String measurementTypeKey
```

Data type being synced.

#### SyncProgress.status [#syncprogressstatus]

```dart
final SyncProgressStatus status
```

Current sync stage.

#### SyncProgress.reason [#syncprogressreason]

```dart
final SyncPauseReason? reason
```

Why a paused sync is waiting.

#### SyncProgress.progress [#syncprogressprogress]

```dart
final SyncProgressCounts? progress
```

Records processed and remaining.


## SyncProgressCounts [#syncprogresscounts]

```dart
class SyncProgressCounts
```

Counts for one data type in a sync run.

### Constructors [#constructors-1]

#### SyncProgressCounts.new [#syncprogresscountsnew]

```dart
SyncProgressCounts({
  required int done,
  required int total,
  int? created,
})
```

Creates sync counts.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `done` | `int` | required named |  |
| `total` | `int` | required named |  |
| `created` | `int?` | named |  |

### Properties [#properties-1]

#### SyncProgressCounts.done [#syncprogresscountsdone]

```dart
final int done
```

Records processed so far.

#### SyncProgressCounts.total [#syncprogresscountstotal]

```dart
final int total
```

Records to process.

#### SyncProgressCounts.created [#syncprogresscountscreated]

```dart
final int? created
```

Observations created rather than matched or updated.


## SyncProgressStatus [#syncprogressstatus-1]

```dart
enum SyncProgressStatus
```

Current sync stage for one data type.

### Values [#values-1]

#### SyncProgressStatus.started [#syncprogressstatusstarted]

```dart
static const SyncProgressStatus started
```

A sync run has started.

#### SyncProgressStatus.completed [#syncprogressstatuscompleted]

```dart
static const SyncProgressStatus completed
```

All available records were processed.

#### SyncProgressStatus.failed [#syncprogressstatusfailed]

```dart
static const SyncProgressStatus failed
```

The sync run stopped after an error.

#### SyncProgressStatus.idle [#syncprogressstatusidle]

```dart
static const SyncProgressStatus idle
```

No sync run is active.

#### SyncProgressStatus.syncing [#syncprogressstatussyncing]

```dart
static const SyncProgressStatus syncing
```

Records are being read or saved.

#### SyncProgressStatus.paused [#syncprogressstatuspaused]

```dart
static const SyncProgressStatus paused
```

The sync run is waiting to resume.
