getAllPhotos method Null safety

  1. @override
Future<Result<List<Photo>>> getAllPhotos()
override

Returns result with all available photos.

Implementation

@override
Future<Result<List<Photo>>> getAllPhotos() async {
  try {
    final photoModels = await _dataSource.getAllPhotos();
    final photos = await _mapPhotosFromModels(photoModels);

    return Result(photos);
  } catch (e, s) {
    _logger.e('Getting all photos has failed!', e, s);

    return Result.failure(Failure(e, s));
  }
}