FakeAnalyticsLogger class
Analytics logger that logs each event to the events list. Useful for determining whether events were triggered in tests.
- Implemented types
Constructors
- FakeAnalyticsLogger({bool debugPrint = true})
Properties
- debugPrint → bool
-
Whether events should also be printed to the debug console when logged.
final
-
events
→ List<
FakeEvent> -
List of fake events
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
screenView
→ List<
FakeLogScreenView> -
List of fake screenView
final
- userId ↔ String?
-
getter/setter pair
-
userProperties
↔ Map<
String, String?> -
getter/setter pair
Methods
-
clear(
) → void - Clear the list of fake events and user properties
-
logEvent(
{required String name, Map< String, Object?> ? parameters}) → Future<void> -
Log a generic event.
override
-
logScreenView(
{required String screenName, String? screenClass}) → Future< void> -
On real applications, the event should be loggedan analytics Screen View
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setUserId(
String? id) → Future< void> -
Set the id of the user within the analytics service
override
-
setUserProperty(
String property, String? value) → Future< void> -
Set a property of the user within the analytics service
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited