# Services

## User Service

The `UserService` class provides methods for user authentication and handling user data.

### Methods

#### `authenticateUser({required String username, required String password}) -> Future<UserModel?>`

Authenticates a user based on the provided username and password.

#### `isAuthenticated() -> bool`

Checks if a user is currently authenticated.

#### `getCurrentUser() -> UserModel?`

Retrieves the current authenticated user.

#### `logout() -> void`

Logs out the current user.

#### `updateUserProfile(UserModel newUser) -> void`

Updates the user profile with the provided `UserModel` instance.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flutfast.com/services.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
