toJson abstract method

Map<String, dynamic> toJson()
inherited

toJson method returns JSON representation of the object. The save method invokes this method to get the state which will be persisted to the secondary server.

class that extends AtCollectionModel has to override this method.

e.g We have a class that extends AtCollectionModel and has name and description as it's member.

For such a class toJson would look like:

  @override
  Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = {};
  data['name'] = name;
  data['description'] = description;
  return data;
}

Implementation

Map<String, dynamic> toJson();