toMap method
Implementation
Map<String, dynamic> toMap() {
return {
'name': 'CUSTOM_EVENT', // CUSTOM_EVENT is required
'type': type,
if(params != null) 'params': params,
'sessionId': sessionId,
'userId': userId,
'device': device,
'os': os,
'lang': lang,
};
}