DVOfflineStore constructor
DVOfflineStore({
- required DVRecordTable table,
- required DVOffline policy,
- DVOfflineClock? clock,
- bool? persistent,
- void onAdopted(
- DVRecord record
Implementation
DVOfflineStore({
required this.table,
required this.policy,
DVOfflineClock? clock,
bool? persistent,
this.onAdopted,
}) : clock = clock ?? DVOfflineClock(),
persistent = persistent ?? table.database is! MemoryDVDatabaseAdapter {
if (!policy.strategy.allowedOffline) {
throw DVOfflineStrategyError(policy.strategy);
}
this.clock
.._tolerance = policy.maxClockSkew
.._onSkew = (Duration offset) => _report(
'DV-OFFLINE-004',
'The device clock is ${offset.inMinutes.abs()} minutes '
'${offset.isNegative ? 'ahead of' : 'behind'} the server; '
'writes are stamped with corrected time.',
DVLogLevel.warn,
);
}