track method
Implementation
@override
Future<void> track(String event, {Map<String, dynamic>? properties}) async {
if (event.trim().isEmpty) {
return;
}
await _requestJson(
_apiUrl('/app-events'),
method: 'POST',
headers: _buildHeaders(includeContentType: true),
body: <String, dynamic>{
'event': event,
'platform': 'web',
'timestamp': DateTime.now().millisecondsSinceEpoch ~/ 1000,
if (_userId != null && _userId!.isNotEmpty) 'userId': _userId,
if (properties != null && properties.isNotEmpty) 'props': properties,
},
);
}