toMap method
Implementation
Map<String, dynamic> toMap() {
return {
'event_type': eventType,
if (eventProperties != null) 'event_properties': eventProperties,
if (userProperties != null) 'user_properties': userProperties,
if (groups != null) 'groups': groups,
if (groupProperties != null) 'group_properties': groupProperties,
if (userId != null) 'user_id': userId,
if (deviceId != null) 'device_id': deviceId,
if (timestamp != null) 'timestamp': timestamp,
if (eventId != null) 'event_id': eventId,
if (sessionId != null) 'session_id': sessionId,
if (insertId != null) 'insert_id': insertId,
if (locationLat != null) 'location_lat': locationLat,
if (locationLng != null) 'location_lng': locationLng,
if (appVersion != null) 'app_version': appVersion,
if (versionName != null) 'version_name': versionName,
if (platform != null) 'platform': platform,
if (osName != null) 'os_name': osName,
if (osVersion != null) 'os_version': osVersion,
if (deviceBrand != null) 'device_brand': deviceBrand,
if (deviceManufacturer != null) 'device_manufacturer': deviceManufacturer,
if (deviceModel != null) 'device_model': deviceModel,
if (carrier != null) 'carrier': carrier,
if (country != null) 'country': country,
if (region != null) 'region': region,
if (city != null) 'city': city,
if (dma != null) 'dma': dma,
if (idfa != null) 'idfa': idfa,
if (idfv != null) 'idfv': idfv,
if (adid != null) 'adid': adid,
if (appSetId != null) 'app_set_id': appSetId,
if (androidId != null) 'android_id': androidId,
if (language != null) 'language': language,
if (library != null) 'library': library,
if (ip != null) 'ip': ip,
if (plan != null) 'plan': plan?.toMap(),
if (ingestionMetadata != null)
'ingestion_metadata': ingestionMetadata?.toMap(),
if (revenue != null) 'revenue': revenue,
if (price != null) 'price': price,
if (quantity != null) 'quantity': quantity,
if (productId != null) 'product_id': productId,
if (revenueType != null) 'revenue_type': revenueType,
if (extra != null) 'extra': extra,
if (partnerId != null) 'partner_id': partnerId,
'attempts': attempts,
};
}