Skip to content

Account Management

The Account section serves as the user’s personal hub within the application. From here, they can view their profile, manage their content preferences, access saved articles, and control their sign-in status.

  • AccountBloc: This is the primary BLoC for managing a user’s content preferences (UserContentPreferences). It listens for changes in the user’s authentication state from the AppBloc. When a user signs in, it loads their preferences. It also handles all actions related to modifying these preferences, such as saving an article or following a topic.

  • AccountPage: The main UI for this feature. It displays the user’s email or an “Anonymous” status, provides a sign-out or link-account button, and offers navigation to sub-pages for managing saved and followed content.

  • SavedHeadlinesPage: A dedicated page that displays a list of all the headlines the user has saved. Users can view or remove articles from this list.

Centralized User Preferences

The AccountBloc is responsible for fetching, creating, and updating a user’s UserContentPreferences object. This single object holds all of the user’s content-related settings, including lists of followed topics, followed sources, and saved headlines.

Saved Articles

Users can save any headline for later reading. This action dispatches an AccountSaveHeadlineToggled event to the AccountBloc. The SavedHeadlinesPage then displays a clean, scrollable list of these saved articles.

Followed Content Management

The “Content Preferences” section allows users to manage the topics and sources they follow. This is where the AvailableTopicsBloc and AvailableSourcesBloc are used to fetch lists of all available entities that the user can choose to follow or unfollow.

Seamless Anonymous to Authenticated Flow

The AccountPage intelligently adapts its UI based on the user’s status. For anonymous users, it presents a clear call-to-action to “link” their account, providing a smooth transition to the authentication flow to save their preferences permanently.