PlayerDataRightsService class
A complete "player requested their data" workflow (GDPR/CCPA-style) built on top of StorageService.exportAll/StorageService.eraseAll — those give the low-level mechanism, this gives the business workflow: a clear export receipt with metadata, and an erasure receipt confirming completion + which other seams got a chance to clean up their own side.
Why hooks, not new methods on AnalyticsProvider/CrashReporter:
those seams are deliberately minimal (logEvent/recordError only),
and a real analytics/crash SDK's actual "delete this user's data" API is
vendor-specific — not something a 1-size-fits-all abstract method could
meaningfully wrap. registerErasureHook instead lets a consuming app
wire in whatever cleanup its own adapters need, generically — not
limited to those 2 seams.
Constructors
- PlayerDataRightsService({required StorageService storage, int nowMs()?})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storage → StorageService
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerErasureHook(
String label, Future< void> hook()) → void -
Registers a best-effort cleanup hook (e.g. clear an
AnalyticsProvider/CrashReporter adapter's own locally-cached data)
to run during requestErasure, after the local storage wipe. A
second call with the same
labelreplaces the prior hook. -
requestErasure(
) → Future< DataErasureReceipt> - Wipes storage completely (via StorageService.eraseAll), then runs every registered erasure hook best-effort (a hook that throws is recorded as failed in the returned receipt, never rethrown — 1 failing hook can't block the others or undo the already-completed storage wipe), and returns a DataErasureReceipt confirming completion.
-
requestExport(
) → DataExportReceipt - Exports everything currently in storage as a DataExportReceipt — synchronous and never throws, since StorageService.exportAll itself never does.
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterErasureHook(
String label) → void -
Removes a previously-registered hook — a no-op if
labelwas never registered.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- schemaVersion → const int