LCUser class

LeanCloud User.

Inheritance

Constructors

LCUser()

Properties

acl LCACL?
Gets the ACL for this object.
getter/setter pairinherited
authData Map?
getter/setter pair
className String?
The class name of the object.
no setterinherited
createdAt DateTime?
Gets the object's createdAt attribute.
no setterinherited
email String?
getter/setter pair
emailVerified bool?
no setter
hashCode int
The hash code for this object.
no setterinherited
isAnonymous bool
Checks whether this user is anonymous.
no setter
mobile String?
getter/setter pair
mobileVerified bool?
no setter
objectId String?
Gets the object's objectId.
no setterinherited
password String?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionToken String?
getter/setter pair
updatedAt DateTime?
Gets the object's updatedAt attribute.
no setterinherited
username String?
getter/setter pair

Methods

add(String key, dynamic value) → void
Atomically add value to the end of the array key.
inherited
addAll(String key, Iterable values) → void
Atomically add values to the end of the array key.
inherited
addAllUnique(String key, Iterable values) → void
Atomically add values to the array key, only if not already present.
inherited
addRelation(String key, LCObject value) → void
Adds a relation value to key.
inherited
addUnique(String key, dynamic value) → void
Atomically add value to the array key, only if not already present.
inherited
associateAuthData(Map<String, dynamic> authData, String platform) Future
Associates this LCUser with a third party authData.
associateAuthDataAndUnionId(Map<String, dynamic> authData, String platform, String unionId, {LCUserAuthDataLoginOption? option}) Future
Associates this user with a third party authData and unionId.
decrement(String key, num amount) → void
Atomically decrements the value of the given key with amount.
inherited
delete() Future
Deletes this object.
inherited
disassociateWithAuthData(String platform) Future
Unlinks a user from a third party platform.
fetch({Iterable<String>? keys, Iterable<String>? includes}) Future<LCObject>
Fetches the object from the cloud.
inherited
follow(String targetId, {Map<String, dynamic>? attrs}) Future
Follows a user whose objectId is targetId.
followeeQuery() LCQuery<LCObject>
Constructs a followee query.
followerQuery() LCQuery<LCObject>
Constructs a follower query.
getFollowersAndFollowees({bool includeFollower = false, bool includeFollowee = false, bool returnCount = false}) Future<LCFollowersAndFollowees>
Queries followers and followees at the same time.
increment(String key, num amount) → void
Atomically increments the value of the given key with amount.
inherited
isAuthenticated() Future<bool>
Checks whether the current sessionToken is valid.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String key, dynamic value) → void
Atomically remove all value from the array key.
inherited
removeAll(String key, Iterable values) → void
Atomically remove all values from the array key.
inherited
removeRelation(String key, LCObject value) → void
Removes relation value to key.
inherited
save({bool fetchWhenSave = false, LCQuery<LCObject>? query}) Future<LCUser>
Saves the object to the cloud.
override
signUp() Future<LCUser>
Signs up a new user.
toString() String
Serializes this LCObject to a JSON string.
inherited
unfollow(String targetId) Future
Unfollows a user whose objectId is targetId.
unset(String key) → void
Removes the key.
inherited
updatePassword(String oldPassword, String newPassword) Future
Updates newPassword safely with oldPassword.

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String key) → dynamic
Gets the value of key.
inherited
operator []=(String key, dynamic value) → void
Sets key to value.
inherited

Static Methods

becomeWithSessionToken(String sessionToken) Future<LCUser>
Signs in a user with a sessionToken.
getCurrent() Future<LCUser?>
Retrieves the currently logged in LCUser with a valid session.
getQuery() LCQuery<LCUser>
Constructs a LCQuery for LCUser.
login(String username, String password) Future<LCUser>
Signs in a user with their username and password.
loginAnonymously() Future<LCUser>
Creates an anonymous user.
loginByEmail(String email, String password) Future<LCUser>
Signs in a user with their email and password.
loginByMobilePhoneNumber(String mobile, String password) Future<LCUser>
Signs in a user with their mobile number and password.
loginBySMSCode(String mobile, String code) Future<LCUser>
Signs in a LCUser with their mobile number and verification code.
loginWithAuthData(Map<String, dynamic> authData, String platform, {LCUserAuthDataLoginOption? option}) Future<LCUser>
Signs up or signs in a user with third party authData.
loginWithAuthDataAndUnionId(Map<String, dynamic> authData, String platform, String unionId, {LCUserAuthDataLoginOption? option}) Future<LCUser>
Signs up or signs in a user with third party authData and unionId.
logout() Future
Logs out the currently logged in user session.
requestEmailVerify(String email) Future
Requests a verification email to be sent to a user's email address.
requestLoginSMSCode(String mobile, {String? validateToken}) Future
Requests a login sms code to be sent to the mobile number of an existing user.
requestMobilePhoneVerify(String mobile) Future
Requests a verification SMS to be sent to a user's mobile number.
requestPasswordReset(String email) Future
Requests a password reset email to be sent to a user's email address.
requestPasswordRestBySmsCode(String mobile) Future
Requests a reset password sms code to be sent to a user's mobile number.
requestSMSCodeForUpdatingPhoneNumber(String mobile, {int ttl = 360, String? captchaToken}) Future
Requests an SMS code for updating phone number.
resetPasswordBySmsCode(String mobile, String code, String newPassword) Future
Resets a user's password via mobile phone.
signUpOrLoginByMobilePhone(String mobile, String code) Future<LCUser>
Signs up or signs in a LCUser with their mobile number and verification code.
verifyCodeForUpdatingPhoneNumber(String mobile, String code) Future
Verify code for updating phone number.
verifyMobilePhone(String mobile, String code) Future
Requests to verify a user's mobile number with sms code they received.

Constants

ClassName → const String