LCObject class

LeanCloud Object

Object is also called Record (in traditional relational databases) or Document (in some NoSQL databases).

Implementers

Constructors

LCObject(String className)
Creates a new object in className.

Properties

acl ↔ LCACL?
Gets the ACL for this object.
getter/setter pair
className → String?
The class name of the object.
no setter
createdAt → DateTime?
Gets the object's createdAt attribute.
no setter
hashCode → int
The hash code for this object.
no setterinherited
objectId → String?
Gets the object's objectId.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
updatedAt → DateTime?
Gets the object's updatedAt attribute.
no setter

Methods

add(String key, dynamic value) → void
Atomically add value to the end of the array key.
addAll(String key, Iterable values) → void
Atomically add values to the end of the array key.
addAllUnique(String key, Iterable values) → void
Atomically add values to the array key, only if not already present.
addRelation(String key, LCObject value) → void
Adds a relation value to key.
addUnique(String key, dynamic value) → void
Atomically add value to the array key, only if not already present.
decrement(String key, num amount) → void
Atomically decrements the value of the given key with amount.
delete() → Future
Deletes this object.
fetch({Iterable<String>? keys, Iterable<String>? includes}) → Future<LCObject>
Fetches the object from the cloud.
increment(String key, num amount) → void
Atomically increments the value of the given key with amount.
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.
removeAll(String key, Iterable values) → void
Atomically remove all values from the array key.
removeRelation(String key, LCObject value) → void
Removes relation value to key.
save({bool fetchWhenSave = false, LCQuery<LCObject>? query}) → Future<LCObject>
Saves the object to the cloud.
toString() → String
Serializes this LCObject to a JSON string.
override
unset(String key) → void
Removes the key.

Operators

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

Static Methods

createWithoutData(String className, String objectId) → LCObject
Constructs a object in className of objectId.
deleteAll(List<LCObject> objectList) → Future
Delete all objects in objectList.
fetchAll(List<LCObject> objectList) → Future<List<LCObject>>
Fetches all objects in objectList.
parseObject(String str) → LCObject
The inverse function of toString.
registerSubclass<T extends LCObject>(String className, Function constructor) → void
Registers a subclass named className with constructor.
saveAll(List<LCObject> objectList) → Future<List<LCObject>>
Saves all objects in objectList.