toMap method
Implementation
Map<String, dynamic> toMap() {
return {
'name': 'USER_OPERATIONS', // USER_OPERATIONS is required
'step': getUserOperationStep(step),
if (username != null && username != '') 'username': username,
if (fullName != null && fullName != '') 'fullName': fullName,
if (email != null && email != '') 'email': email,
if (phone != null && phone != '') 'phone': phone,
if (gender != null && gender != '') 'gender': gender,
if (age != null && age != '') 'age': age,
if (birthdate != null && birthdate != '') 'birthdate': birthdate,
if (memberSince != null && memberSince != '') 'memberSince': memberSince,
if (location != null && location != '') 'location': location,
if (segments != null) 'segments': segments,
if (isLogin != null) 'isLogin': isLogin,
if (isRegistered != null) 'isRegistered': isRegistered,
'sessionId': sessionId,
'userId': userId,
'device': device,
'os': os,
'lang': lang,
};
}