get<R> method

  1. @override
Future<Response<UserEntity>> get<R>(
  1. String id, {
  2. bool fromCache = false,
  3. R? source(
    1. R parent
    )?,
})
override

Implementation

@override
Future<Response<UserEntity>> get<R>(
  String id, {
  bool fromCache = false,
  R? Function(R parent)? source,
}) async {
  try {
    if (fromCache) {
      return localDataRepository.get(id: id);
    } else {
      return repository.get(id, source);
    }
  } catch (_) {
    return Future.error("$_");
  }
}