trackEvent method
Track an event.
Implementation
@override
Future<void> trackEvent(
String eventName,
Map<String, Object>? eventParams,
List<String>? segmentationEventParamKeys,
) async {
final args = <String, dynamic>{
'eventName': eventName,
'eventParams': eventParams,
'segmentationEventParamKeys': segmentationEventParamKeys,
};
final success = await channel.invokeMethod<bool>('trackEvent', args);
if (success == null || !success) {
throw PlatformException(
code: 'TRACK_EVENT_FAILED',
message: 'Tracking event failed',
);
}
}