updateModel method

Future<T> updateModel(
  1. T model, {
  2. String? databaseName,
})

Updates the given model to the map and the given database in repository

Implementation

Future<T> updateModel(T model, {String? databaseName}) async {
  final database = specificDatabase(databaseName);

  final newModel = await database.saveModel<T>(model);
  addLoadedModels([newModel]);
  return newModel;
}