- 23 Dec 2023
- 4 Minutes to read
Event Object
- Updated on 23 Dec 2023
- 4 Minutes to read
The Event object helps you create custom events and event parameters in different data types.
Set tag event
This method returns a new chainable Insider event object in which you can add parameters.
Parameter | Data Type |
---|---|
eventName | String |
Method Signature
FlutterInsiderEvent tagEvent(String eventName)
Method Example
// You can create an event without parameters and call the build method.
FlutterInsider.Instance.tagEvent("eventName").build();
// You can create an event, then add parameters and call the build method.
FlutterInsider.Instance.tagEvent("eventName")
.addParameterWithInt("key", 10)
.build();
// You can create an object and add the parameters later.
FlutterInsiderEvent insiderExampleEvent = FlutterInsider.Instance.tagEvent("eventName");
// Do not forget to call build method after implementing the desired parameters to the related event.
//Otherwise your event will be ignored.
insiderExampleEvent.build();
Build event
This method allows you to build your Insider event object.
Method Signature
Future build() async
Method Example
insiderExampleEvent.build();
Set string parameter
This method allows you to set the string parameter of your Insider event object.
Parameter | Data Type |
---|---|
key | String |
value | String |
Method Signature
FlutterInsiderEvent addParameterWithString(String key, String value)
Method Example
// You can create an event, then add parameters and call the build method.
FlutterInsider.Instance.tagEvent("eventName")
.addParameterWithString("key", "value")
.build();
// You can create an object and add the parameters later.
FlutterInsiderEvent insiderExampleEvent = FlutterInsider.Instance.tagEvent("eventName");
insiderExampleEvent.addParameterWithString("key", "value");
// Do not forget to call build method after implementing the desired parameters to the related event.
// Otherwise your event will be ignored.
insiderExampleEvent.build();
Set integer parameter
This method allows you to set the integer parameter of your Insider event object.
Parameter | Data Type |
---|---|
key | String |
value | Integer |
Method Signature
FlutterInsiderEvent addParameterWithInt(String key, int value)
Method Example
// You can create an event, then add parameters and call the build method.
FlutterInsider.Instance.tagEvent("eventName")
.addParameterWithInt("key", 10)
.build();
// You can create an object and add the parameters later.
FlutterInsiderEvent insiderExampleEvent = FlutterInsider.Instance.tagEvent("eventName");
insiderExampleEvent.addParameterWithInt("key", 10);
// Do not forget to call build method after implementing the desired parameters to the related event.
// Otherwise your event will be ignored.
insiderExampleEvent.build();
Set double parameter
This method allows you to set the double parameter of your Insider event object.
Parameter | Data Type |
---|---|
key | String |
value | Double |
Method Signature
FlutterInsiderEvent addParameterWithDouble(String key, double value)
Method Example
// You can create an event, then add parameters and call the build method.
FlutterInsider.Instance.tagEvent("eventName")
.addParameterWithDouble("key", 10.5)
.build();
// You can create an object and add the parameters later.
FlutterInsiderEvent insiderExampleEvent = FlutterInsider.Instance.tagEvent("eventName");
insiderExampleEvent.addParameterWithDouble("key", 10.5);
// Do not forget to call build method after implementing the desired parameters to the related event.
// Otherwise your event will be ignored.
insiderExampleEvent.build();
Set date parameter
This method allows you to set the date parameter of your Insider event object.
Parameter | Data Type |
---|---|
key | String |
value | Date |
Method Signature
FlutterInsiderEvent addParameterWithDate(String key, DateTime value)
Method Example
// You can create an event, then add parameters and call the build method.
FlutterInsider.Instance.tagEvent("eventName")
.addParameterWithDate("key", new DateTime.now())
.build();
// You can create an object and add the parameters later.
FlutterInsiderEvent insiderExampleEvent = FlutterInsider.Instance.tagEvent("eventName");
insiderExampleEvent.addParameterWithDate("key", new DateTime.now());
// Do not forget to call build method after implementing the desired parameters to the related event.
// Otherwise your event will be ignored.
insiderExampleEvent.build();
Set array parameter
This method allows you to set the array parameter of your Insider event object.
Parameter | Data Type |
---|---|
key | String |
value | Array (of string) |
Method Signature
FlutterInsiderEvent addParameterWithArray(String key, List value)
Method Example
List<String> arr = new List(3);
arr[0] = "item1";
arr[1] = "item2";
arr[2] = "item3";
// You can create an event, then add parameters and call the build method.
FlutterInsider.Instance.tagEvent("eventName")
.addParameterWithArray("key", arr)
.build();
// You can create an object and add the parameters later.
FlutterInsiderEvent insiderExampleEvent = FlutterInsider.Instance.tagEvent("eventName");
insiderExampleEvent.addParameterWithArray("key", arr);
// Do not forget to call build method after implementing the desired parameters to the related event.
// Otherwise your event will be ignored.
insiderExampleEvent.build();
Set boolean parameter
This method allows you to set the boolean parameter of your Insider event object.
Parameter | Data Type |
---|---|
key | String |
value | Boolean |
Method Signature
FlutterInsiderEvent addParameterWithBoolean(String key, bool value)
Method Example
// You can create an event, then add parameters and call the build method.
FlutterInsider.Instance.tagEvent("eventName")
.addParameterWithBoolean("key", true)
.build();
// You can create an object and add the parameters later.
FlutterInsiderEvent insiderExampleEvent = FlutterInsider.Instance.tagEvent("eventName");
insiderExampleEvent.addParameterWithBoolean("key", true);
// Do not forget to call build method after implementing the desired parameters to the related event.
// Otherwise your event will be ignored.
insiderExampleEvent.build();