DataExporter class final
Collects the user's data from every registered DataSource into one JSON document ("export my data", GDPR Art. 15 and 20).
One failing source does not stop the export. Its status is reported in DataExport.results and in the document, so nothing fails silently.
Constructors
- DataExporter({required String appId, AuditTrail? auditTrail, void onAuditError(Object error)?, Duration sourceTimeout = const Duration(seconds: 30), DateTime clock()?})
- Creates an exporter.
Properties
- appId → String
-
App identifier written to the export.
final
- auditTrail → AuditTrail?
-
Optional audit trail for
data_exportedevents. Recorded in the background; a slow trail does not delay the export.final - hashCode → int
-
The hash code for this object.
no setterinherited
- onAuditError → void Function(Object error)?
-
Called when recording an audit event fails.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sourceIds
→ List<
String> -
Ids of registered sources, in registration order.
no setter
- sourceTimeout → Duration
-
Maximum time per source.
final
Methods
-
export(
{void onProgress(ExportProgress progress)?}) → Future< DataExport> -
Exports every registered source, one after another, reporting
onProgressafter each. An exception thrown byonProgressis ignored and does not stop the export. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
DataSource source) → void -
Registers
source. -
toString(
) → String -
A string representation of this object.
inherited
-
unregister(
String id) → bool -
Removes the source with
id. Returns whether it was registered.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited