DVAnalyticsRuntime class

The analytics pipeline for this process, as DV.Analytics.

Started once, by the generated runtime. Everything it does waits for the stored consent to have been read: an event tracked in the first milliseconds of a launch would otherwise be judged against the declared defaults rather than against what the person chose, and a category that defaults to granted would record an event from somebody who withdrew it yesterday.

Available extensions

Properties

Consent, once it has been read.
no setter
hashCode → int
The hash code for this object.
no setterinherited
loadedConsent → DVConsent?
Consent when it has already been read, and null before: for a widget that must not show a choice it cannot yet know the answer to.
no setter
pipeline → Future<DVAnalytics>
The pipeline, once ready.
no setter
ready → Future<void>
Completes once the stored consent has been read; with an error when the pipeline could not start.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
settings → DVAnalyticsSettings
final

Methods

ConsentBanner({required Widget child}) → Widget

Available on DVAnalyticsRuntime, provided by the DVAnalyticsConsentPages extension

A DVConsentBanner over child for this runtime.
ConsentSettingsPage() → Widget

Available on DVAnalyticsRuntime, provided by the DVAnalyticsConsentPages extension

A DVConsentSettingsPage for this runtime.
flush() → Future<int>
Delivers queued events. See DVAnalytics.flush.
identify(String? userId) → Future<void>
Sets who later events belong to. See DVAnalytics.identify.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
track(DVAnalyticsEvent event) → Future<DVTrackResult>
Checks consent, once it has been read, and queues event.
whenReady(void listener()) → void
Calls listener once consent has been read. Called at once when it already has been.

Operators

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

Static Properties

current → DVAnalyticsRuntime
The configured runtime.
no setter
isConfigured → bool
Whether a runtime has been started in this process.
no setter

Static Methods

resetForTest() → void
Forgets the runtime, for tests.
start({required DVAnalyticsSettings settings, required FutureOr<DVDatabaseAdapter> database(), List<DVAnalyticsProvider> providers = const <DVAnalyticsProvider>[], Set<String> sensitiveFields = const <String>{}}) → DVAnalyticsRuntime
Starts the pipeline over the database database opens, and makes it the process's DV.Analytics.

Constants

installIdKey → const String
The name of the row in the identity table holding this install's id.