idempotency library

Client-side idempotency keys for Dart and Flutter.

Pair with a server that honors Idempotency-Key headers (Stripe-style): every logical operation gets a key that is created and persisted before the request fires and reused for every retry — even across app restarts — so a flaky network can never submit the same operation twice.

Classes

IdempotencyKeys
Manages one idempotency key per logical operation.

Constants

visibleForTesting → const _VisibleForTesting

Typedefs

KeyLoader = String? Function(String operation)
Reads the persisted key for an operation (null when none was stored).
KeyStore = void Function(String operation, String? key)
Persists the key for a logical operation. Called before the request fires — it must complete (or be synchronous) for the guarantee to hold.