getUser method

Future<Response> getUser(
  1. String idOrEmail, {
  2. bool? includeRole,
})

Get a user by ID or email

Implementation

Future<Response> getUser(String idOrEmail, {bool? includeRole}) async {
  try {
    final response = await _dio.get(
      '/users/$idOrEmail',
      queryParameters: {
        if (includeRole != null) 'includeRole': includeRole,
      },
    );
    return response;
  } on DioException catch (e) {
    throw Exception('Failed to retrieve user: ${e.message}');
  }
}