findById method

Future<User> findById(
  1. String id
)

Returns a user by id or throws NotFoundException.

Implementation

Future<User> findById(String id) async {
  final user = await _repo.findById(id);
  if (user == null) throw NotFoundException('User $id not found');
  return user;
}