getUser method

Future<UserModel> getUser(
  1. String userId
)

Gets a specific user by ID.

Makes a GET /user/:userId request.

Returns the UserModel.

Throws DioError on failure.

Implementation

Future<UserModel> getUser(String userId) async {
  final response = await client.dio.get(ApiEndpoints.getUser(userId));
  return UserModel.fromJson(response.data as Map<String, dynamic>);
}