create method

Future<T> create(
  1. T entity
)

Implementation

Future<T> create(T entity) async {
  _logger.d('[OfflineFirstRepository] Creating entity');
  final entityWithLocalFile = await _copyFileToLocalStorage(entity);
  final createdEntity = await localRepository.create(entityWithLocalFile);
  _logger
      .d('[OfflineFirstRepository] Entity created locally. Triggering sync');
  unawaited(_syncChanges());
  return createdEntity;
}