capture method
Implementation
@override
Future<void> capture({
required String eventName,
Map<String, Object>? properties,
Map<String, Object>? userProperties,
Map<String, Object>? userPropertiesSetOnce,
}) async {
final extracted = CaptureUtils.extractUserProperties(
properties: properties,
userProperties: userProperties,
userPropertiesSetOnce: userPropertiesSetOnce,
);
final extractedProperties = extracted.properties;
final extractedUserProperties = extracted.userProperties;
final extractedUserPropertiesSetOnce = extracted.userPropertiesSetOnce;
final normalizedProperties = extractedProperties != null
? PropertyNormalizer.normalize(extractedProperties)
: null;
final normalizedUserProperties = extractedUserProperties != null
? PropertyNormalizer.normalize(extractedUserProperties)
: null;
final normalizedUserPropertiesSetOnce =
extractedUserPropertiesSetOnce != null
? PropertyNormalizer.normalize(extractedUserPropertiesSetOnce)
: null;
return handleWebMethodCall(MethodCall('capture', {
'eventName': eventName,
if (normalizedProperties != null) 'properties': normalizedProperties,
if (normalizedUserProperties != null)
'userProperties': normalizedUserProperties,
if (normalizedUserPropertiesSetOnce != null)
'userPropertiesSetOnce': normalizedUserPropertiesSetOnce,
}));
}