Analytics class abstract

Implementers

Constructors

Analytics({required DashTool tool, required String dartVersion, String? flutterChannel, String? flutterVersion, String? clientIde, String? enabledFeatures, bool enableAsserts = false})
The default factory constructor that will return an implementation of the Analytics abstract class using the LocalFileSystem.
factory
Analytics.development({required DashTool tool, required String dartVersion, String? flutterChannel, String? flutterVersion, String? clientIde, String? enabledFeatures, bool enableAsserts = true})
Factory constructor to return the AnalyticsImpl class with Google Analytics credentials that point to a test instance and not the production instance where live data will be sent.
factory

Properties

clientId String
The shared identifier for Flutter and Dart related tooling using package:unified_analytics.
no setter
getConsentMessage String
Retrieves the consent message to prompt users with on first run or when the message has been updated.
no setter
hashCode int
The hash code for this object.
no setterinherited
okToSend bool
Returns true if it is OK to send an analytics message. Do not cache, as this depends on factors that can change, such as the configuration file contents.
no setter
parsedTools Map<String, ToolInfo>
Returns a map object with all of the tools that have been parsed out of the configuration file.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldShowMessage bool
Boolean that lets the client know if they should display the message.
no setter
telemetryEnabled bool
Boolean indicating whether or not telemetry is enabled.
no setter
userPropertyMap Map<String, Map<String, Object?>>
Returns a map representation of the UserProperty for the Analytics instance.
no setter

Methods

clientShowedMessage() → void
Method to be invoked by the client using this package to confirm that the client has shown the message and that it can be added to the config file and start sending events the next time it starts up.
close({int delayDuration = kDelayDuration}) Future<void>
Call this method when the tool using this package is closed.
fetchAvailableSurveys() Future<List<Survey>>
Method to fetch surveys from the endpoint kContextualSurveyUrl.
logFileStats() LogFileStats?
Query the persisted event data stored on the user's machine.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(Event event) → void
Send preconfigured events using specific named constructors on the Event class.
setTelemetry(bool reportingBool) Future<void>
Pass a boolean to either enable or disable telemetry and make the necessary changes in the persisted configuration file.
suppressTelemetry() → void
Calling this will result in telemetry collection being suppressed for the current invocation.
surveyInteracted({required Survey survey, required SurveyButton surveyButton}) → void
Method to run after interacting with a Survey instance.
surveyShown(Survey survey) → void
Method to be called after a survey has been shown to the user.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

fake({required DashTool tool, required Directory homeDirectory, required String dartVersion, required MemoryFileSystem fs, String? flutterChannel, String? flutterVersion, String? clientIde, String? enabledFeatures, SurveyHandler? surveyHandler, GAClient? gaClient, DevicePlatform platform = DevicePlatform.linux, int toolsMessageVersion = kToolsMessageVersion, String toolsMessage = kToolsMessage, bool enableAsserts = true}) FakeAnalytics
Returns an instance of FakeAnalytics which can be used in tests to check for certain Event instances within FakeAnalytics.sentEvents.