testing library

Test utilities for flutter_offline_sync_manager.

import 'package:flutter_offline_sync_manager/testing.dart';

Provides an in-memory store plus scriptable fakes for the adapter and connectivity, so sync flows can be tested without Hive, a network or a device.

Classes

FakeConnectivityService
Controllable ConnectivityService for tests and demos.
FakeSyncAdapter
Scriptable SyncAdapter for tests and demos.
InMemorySyncStore
A non-persistent SyncStore that keeps tasks in memory.

Typedefs

FakeBatchHandler = FutureOr<SyncResult> Function(List<SyncTask> batch)
Decides the result for one batch in a FakeSyncAdapter.