Skip to content

Updating Single Object


Future<Map>"TABLE-NAME").save(Map entity);
Future<E><E>().save(E entity);


Argument                Description
TABLE-NAME Name of the table where the object represented by Map will be updated. There must be objectId property in the map. The value of the property identifies the object which will be updated.
E Dart class of the data object to update.
entity Dart object to persist, must be of type E or Map (depending on the method used).

Return Value

The updated object of type E or Map.


void updateContact() {
  // create new contact object first. Then we will update it.
  Map contact = {
    "name": "Jack Daniels",
    "age": 147,
    "phone": "777-777-777",
    "title": "Favorites",
  };"Contact").save(contact).then((savedContact) {
    savedContact["title"] = "Most favorite";
    savedContact["phone"] = "666-666-666";"Contact").save(savedContact).then((response) {
      // Contact object has been updated

Consider the following class:

import 'package:backendless_sdk/backendless_sdk.dart';

class Contact {
  String objectId;
  String name;
  int age;
  String phone;
  String title;
The following code saves a new instance of the Contact class and subsequently updates it:
void updateContact() {
  Contact contact = Contact() = "Jack Daniels"
    ..age = 147 = "777-777-777"
    ..title = "Favorites";<Contact>().save(contact).then((savedContact) {
    // now update the saved object
    savedContact.title = "Most favorite"; = "666-666-666";<Contact>().save(savedContact).then((response) {
      // Contact instance has been updated