create method

Future<String> create(
  1. T item, {
  2. String? wantedId,
})

Creates a new entry in the repository. Returns the id of the new entry.

Implementation

Future<String> create(T item, {String? wantedId}) async {
  final Model raw = await repository.create(wantedId: wantedId);
  await repository.update(item.copyWith(id: raw.id).toModel());

  return raw.id;
}