FakeAnalytics class

This fake instance of Analytics is intended to be used by clients of this package for testing purposes. It exposes a list sentEvents that keeps track of all events that have been sent.

This is useful for confirming that events are being sent for a given workflow. Invoking the send method on this instance will not make any network requests to Google Analytics.

Constructors

FakeAnalytics({required DashTool tool, required Directory homeDirectory, required String dartVersion, required DevicePlatform platform, required FileSystem fs, required SurveyHandler surveyHandler, String? flutterChannel, String? flutterVersion, String? clientIde, String? enabledFeatures, int? toolsMessageVersion, GAClient? gaClient})
Class to use when you want to see which events were sent

Properties

clientId String
The shared identifier for Flutter and Dart related tooling using package:unified_analytics.
no setterinherited
fs → FileSystem
finalinherited
getConsentMessage String
Retrieves the consent message to prompt users with on first run or when the message has been updated.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
okToSend bool
Checking the telemetryEnabled boolean reflects what the config file reflects.
no setterinherited
parsedTools Map<String, ToolInfo>
Returns a map object with all of the tools that have been parsed out of the configuration file.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sentEvents List<Event>
Use this list to check for events that have been emitted when invoking the send method
final
shouldShowMessage bool
Boolean that lets the client know if they should display the message.
no setterinherited
telemetryEnabled bool
Boolean indicating whether or not telemetry is enabled.
no setterinherited
tool DashTool
finalinherited
toolsMessageVersion int
finalinherited
userProperty ↔ UserProperty
latefinalinherited
userPropertyMap Map<String, Map<String, Object?>>
Returns a map representation of the UserProperty for the Analytics instance.
no setterinherited

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.
inherited
close({int delayDuration = kDelayDuration}) Future<void>
Call this method when the tool using this package is closed.
inherited
fetchAvailableSurveys() Future<List<Survey>>
Method to fetch surveys from the endpoint kContextualSurveyUrl.
inherited
logFileStats() LogFileStats?
Query the persisted event data stored on the user's machine.
inherited
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.
inherited
suppressTelemetry() → void
Calling this will result in telemetry collection being suppressed for the current invocation.
inherited
surveyInteracted({required Survey survey, required SurveyButton surveyButton}) → void
Method to run after interacting with a Survey instance.
inherited
surveyShown(Survey survey) → void
Method to be called after a survey has been shown to the user.
inherited
toString() String
A string representation of this object.
inherited

Operators

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