save method
Save or update the current state. Return a new instance. The save method do not update current instance.
Implementation
Future<T> save([Map<String, dynamic>? overrideData]) async {
var data = {
'createdAt': DateTime.now().toString(),
...this.toMap(),
...overrideData ?? {},
'uuid': uuid ?? _uuid.v1(),
'updatedAt': DateTime.now().toString(),
};
await storeRef.record(data['uuid'].toString()).put(await database, data);
var model = this._buildModel(data);
_controller.add(model);
return model;
}