toJson method
Implementation
Map<String, dynamic> toJson() => {
if (id != null) "id": id,
if (firstName != null) "first_name": firstName,
if (lastName != null) "last_name": lastName,
if (fullName != null) "full_name": fullName,
if (userName != null) "username": userName,
if (homeTown != null) "hometown": homeTown,
if (email != null) "email": email,
if (latitude != null) "latitude": latitude,
if (longitude != null) "longitude": longitude,
if (address != null) "address": address,
if (country != null) "country": country,
if (state != null) "state": state,
if (city != null) "city": city,
if (displayName != null) "display_name": displayName,
if (updatedAt != null) "updated_at": updatedAt,
if (contactNumber != null) "contact_number": contactNumber,
if (accountType != null) "account_type": accountType,
if (userType != null) "user_type": userType,
if (businessIds != null) "business_ids": businessIds == null ? [] : List<dynamic>.from(businessIds!.map((x) => x)),
if (interestIds != null) "interest_ids": interestIds == null ? [] : List<dynamic>.from(interestIds!.map((x) => x)),
if (musicTypeIds != null) "music_type_ids": musicTypeIds == null ? [] : List<dynamic>.from(musicTypeIds!.map((x) => x)),
if (status != null) "status": status,
if (timeZone != null) "time_zone": timeZone,
if (lastNotificationSeen != null) "last_notification_seen": lastNotificationSeen,
if (emailVerifiedAt != null) "email_verified_at": emailVerifiedAt,
if (loginType != null) "login_type": loginType,
if (uid != null) "uid": uid,
if (socialImage != null) "social_image": socialImage,
if (isOnline != null) "is_online": isOnline,
if (lastOnlineTime != null) "last_online_time": lastOnlineTime,
if (otp != null) "otp": otp,
if (rememberToken != null) "remember_token": rememberToken,
if (profileImage != null) "profile_image": profileImage,
if (password != null) "password": password,
if (passwordConfirmation != null) "password_confirmation": passwordConfirmation,
if (dob != null) "dob": dob,
if (apiToken != null) "api_token": apiToken,
if (aboutMe != null) "about_me": aboutMe,
if (gender != null) "gender": gender,
if (relationShipStatus != null) "relationship_status": relationShipStatus,
if (followers != null) "followers": followers,
if (following != null) "following": relationShipStatus,
if (totalReview != null) "total_reviews": totalReview,
if (createdAt != null) "created_at": createdAt,
if (isPrivateAccount != null) "is_private_account": isPrivateAccount,
if (hideFromSearch != null) "hide_from_search": hideFromSearch,
if (hideEvents != null) "hide_events": hideEvents,
if (msgOff != null) "msg_off": msgOff,
if (isProUser != null) "is_pro_user": isProUser,
if (totalClaimBusiness != null)
"total_claim_business": totalClaimBusiness,
if (completeProfile != null) "complete_profile": completeProfile,
if (socialMediaUrl != null)
"social_media_url": socialMediaUrl?.toJson(),
};