SegmentifyEvent class

This class represents a Segmentify event. It provides methods to request credentials from the Segmentify API, send different types of events to the Segmentify API, and fire events by sending event payloads to the Segmentify API.

Example usage:

SegmentifyEvent segmentifyEvent = SegmentifyEvent();

final credentials = await segmentifyEvent.requestCredentials(2);

final pageView = PageViewModel(
 pageType: 'home',
pageUrl: 'https://www.example.com',
);

final response = await segmentifyEvent.pageView(pageView);

Constructors

SegmentifyEvent()

Properties

dio ↔ Dio
The dio property is an instance of the Dio class.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

basketOperation(BasketOperationModel basket) Future
Sends a BASKET_OPERATION event payload to the Segmentify API. The payload parameter is required and represents the event payload to be sent. Returns the response data. Throws an Exception if an error occurs while sending the event payload.
checkout(CheckoutModel checkout) Future
Sends a CHECKOUT event payload to the Segmentify API. The payload parameter is required and represents the event payload to be sent. Returns the response data. Throws an Exception if an error occurs while sending the event payload.
custom(CustomEventModel custom) Future
Sends a CUSTOM event payload to the Segmentify API. The payload parameter is required and represents the event payload to be sent. Returns the response data. Throws an Exception if an error occurs while sending the event payload.
interaction(InteractionModel interaction) Future
Sends an INTERACTION event payload to the Segmentify API. The payload parameter is required and represents the event payload to be sent. Returns the response data. Throws an Exception if an error occurs while sending the event payload.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pageView(PageViewModel pageView) Future
Sends a PAGE_VIEW event payload to the Segmentify API. The payload parameter is required and represents the event payload to be sent. Returns the response data. Throws an Exception if an error occurs while sending the event payload.
productView(ProductViewModel productView) Future
Sends a PRODUCT_VIEW event payload to the Segmentify API. The payload parameter is required and represents the event payload to be sent. Returns the response data. Throws an Exception if an error occurs while sending the event payload.
requestCredentials(int requestedFields) Future<List>
Requests credentials from the Segmentify API. The requestedFields parameter is required and represents the number of credentials to be requested. Returns a list of credentials. Throws an Exception if an error occurs while requesting credentials.
Sends a SEARCH event payload to the Segmentify API. The payload parameter is required and represents the event payload to be sent. Returns the response data. Throws an Exception if an error occurs while sending the event payload.
toString() String
A string representation of this object.
inherited
userChange(UserChangeModel user) Future
Sends a USER_CHANGE event payload to the Segmentify API. The payload parameter is required and represents the event payload to be sent. Returns the response data. Throws an Exception if an error occurs while sending the event payload.
userOperation(UserOperationModel user) Future
Sends a USER_OPERATION event payload to the Segmentify API. The payload parameter is required and represents the event payload to be sent. Returns the response data. Throws an Exception if an error occurs while sending the event payload.

Operators

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