DVConsent class

The consent state of one install, read from its records.

Constructors

DVConsent({required DVConsentPolicy policy, required DVDatabaseAdapter database, required String installId, DateTime clock()?, void onDiagnostic(String code, String message)?})

Properties

database → DVDatabaseAdapter
final
hashCode → int
The hash code for this object.
no setterinherited
installId → String
The install the prompt was shown on. Consent is asked on a device before anybody signs in, so it belongs to the install, with the user recorded beside it when one is known.
final
needsPrompt → bool
Whether nobody has answered under the current version.
no setter
policy → DVConsentPolicy
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(void listener(DVConsentChange change)) → void
boundIdentity(DVConsentCategory category, {required String? userId}) → String?
userId when category is granted, and null otherwise: an identity bound to a purpose goes where the purpose goes and nowhere else.
ensureSchema() → Future<void>
isGranted(DVConsentCategory category) → bool
load() → Future<void>
Reads the latest choice for this install. A choice made under another version of the categories is not consent to this one, so it leaves every category at its default and needsPrompt true.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pseudonymize(String subject, String pseudonym) → Future<int>
Replaces subject on every record naming it with pseudonym, keeping what was asked, what was answered, when, and under which version.
record(Map<DVConsentCategory, bool> answers, {Set<DVConsentCategory>? asked, DVConsentPrompt prompt = DVConsentPrompt.settingsScreen, String? userId}) → Future<bool>
Records a choice, and returns whether it was written.
records({String? subject}) → Future<List<DVConsentRecord>>
Records for this install, oldest first; or, given subject, every record whose install or user is subject.
removeListener(void listener(DVConsentChange change)) → void
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

table → const String