track method
Tracks an event with optional properties.
Implementation
Future<void> track({
required String event,
Map<String, dynamic>? properties,
}) async {
if (event.isEmpty) {
NLogger.e("Track event failed: Event name cannot be null or empty.");
return;
}
NLogger.i("Tracking Event: $event, Properties: ${jsonEncode(properties)}");
await _nudgeCoreV2NativeServices.invokeNativeMethod('nudge_track', {
'event': event,
'properties': properties,
});
NLogger.i("Track Event Completed: $event");
}