toJSON method

Map<String, dynamic> toJSON()

DEPRECATED

Implementation

// AppUser.fromFbProfile(profile) :
//   id = profile["id"],
//   name = profile["name"],
//   firstName = profile["first_name"],
//   lastName = profile["last_name"],
//   password = "",
//   email = profile["email"],
//   photoUrl = profile['picture']['data']['url'],
//   userRole = UserRole.subscriber,
//   dateOfBirth = 0,
//   homeTown = "",
//   phoneNumber = "",
//   countryCode = "",
//   isBanned = false,
//   isVerified = false,
//   androidNotificationToken = "",
//   profiles = [],
//   orderIds = [],
//   referralCode = "",
//   fcmToken = "",
//   spotifyToken = "",
//   currentProfileId = "",
//   customerId = '',
//   subscriptionId = '';


Map<String, dynamic> toJSON() {
  return <String, dynamic>{
    //'id': id, //not needed at firebase
    'name': name,
    'firstName': firstName,
    'lastName': lastName,
    'dateOfBirth': dateOfBirth,
    'homeTown': homeTown,
    'password': password,
    'email': email,
    'phoneNumber': phoneNumber,
    'countryCode': countryCode,
    'photoUrl': photoUrl,
    'userRole': userRole.name,
    'isVerified': isVerified,
    'isBanned': isBanned,
    'androidNotificationToken': androidNotificationToken,
    // 'wallet': wallet.toJSON(),
    'orderIds': orderIds,
    'releaseItemIds': releaseItemIds,
    'boughtItems': boughtItems,
    'referralCode': referralCode,
    'createdDate': createdDate,
    'lastTimeOn': lastTimeOn,
    'fcmToken': fcmToken,
    'spotifyToken': spotifyToken,
    'customerId': customerId,
    'subscriptionId': subscriptionId,
  };
}