Skip to content

Conversation

@fulleni
Copy link
Member

@fulleni fulleni commented Nov 20, 2025

Status

READY

Description

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

- Add Arabic and English translations for the in-app notification center
- Include strings for page title, buttons, loading states, failure states, empty states, and tab labels
- Update existing notification-related translations
- Implement in-app notification client and repository
- Integrate in-app notification support with push notification service
- Update bootstrap process to include in-app notification initialization
- Add inAppNotificationRepository to AppInitializationPage constructor
- Pass inAppNotificationRepository to app life cycle status pages
- Update formatting and indentation in the build method
- Add handlers for AppInAppNotificationMarkedAsRead and AppAllInAppNotificationsMarkedAsRead events
- Update AppBloc to listen for in-app notification received events
- Implement logic to update unread notification status
- Add new AppInAppNotificationMarkedAsRead and AppAllInAppNotificationsMarkedAsRead events
- Add InAppNotification repository as a required parameter in App constructor
- Store inAppNotificationRepository as an instance variable
- Provide inAppNotificationRepository using RepositoryProvider
- Pass inAppNotificationRepository to AppBloc initialization
- Add new route for in-app notification center in router.dart
- Define new route constants for notifications in routes.dart
- Import in-app notification center page in router.dart
- Add a new ListTile for notifications in the account page
- Implement a BlocSelector to check for unread notifications
- Create a helper function to build ListTiles with optional indicators
- Update imports to include the shared widgets library
- Add InAppNotificationCenterBloc to manage notification center state
- Implement events for subscription, mark as read, and tab changes
- Define state with status, notifications, and error handling
- Add logic to fetch, filter, and update notifications
- Integrate with AppBloc for global unread status management
…st item widget

- Implement InAppNotificationCenterPage to display a chronological list of in-app notifications
- Add InAppNotificationListItem widget to show individual notifications in a list
- Include functionality to mark notifications as read and navigate to related content
- Add tabs for different notification categories: All, Breaking News, and Digests
- Implement loading, failure, and empty states for the notification list
…tificationService

- Introduce new abstract method for handling in-app notifications
- Update documentation for existing methods
- Add InAppNotification repository dependency
- Implement in-app notification persistence logic
- Add onInAppNotificationReceived stream
- Update registerDevice method to store current user
- Add InAppNotification repository dependency
- Implement in-app notification persistence logic
- Add onInAppNotificationReceived stream
- Update registerDevice method to store current user ID
- Modify handleMessage to create and emit in-app notifications
- Import 'dart:async' for stream support
- Add 'onInAppNotificationReceived' stream to NoOpPushNotificationService
- This change ensures the no-op service implements the full PushNotificationService interface
- Update the color of the notification indicator from error to primary
- This change affects the appearance of the indicator in the UI
- Move in-app notification handling logic from push notification services to AppBloc
- Remove InAppNotification stream and related logic from PushNotificationService implementations
- Update push notification services to only handle message routing
- Simplify registration and device handling in push notification services
- Remove inAppNotificationRepository parameter from FirebasePushNotificationService and OneSignalPushNotificationService
- This change simplifies the push notification service initialization process
- Remove notifications route from main routes list
- Add notifications route inside account modal routes
- This change ensures proper navigation and back stack behavior
- Fixes bug where going back from notifications page would close the app
- Change route path and name from 'notifications' to 'notifications-center'
- Remove duplicate notifications route defined in two places
- Update import order to be consistent with other imports
- Replace incorrect route name `Routes.notificationsName` with correct `Routes.notificationsCenterName`
- This change ensures proper navigation to the Notification Center page when the account notifications tile is tapped
- Remove 'All' tab and related logic
- Consolidate notifications into breaking news and digests only
- Update UI to reflect new tab structure
- Improve code readability and maintainability
- Add in-app notification initialization to the DemoDataInitializerService
- Update bootstrap.dart to include in-app notification repository and fixtures
- Implement logic to clone and assign notifications from fixture data for new users
- Replace deliveryType-based filtering with contentType-based filtering
- Simplify notification categorization into breakingNews and digests
- Ensure all notification types are visible to the user
- Enhance NoOpPushNotificationService to simulate push notifications in demo environment
- Update DemoDataInitializerService to handle empty inAppNotificationsFixturesData
- Modify bootstrap.dart to pass additional parameters to NoOpPushNotificationService
- Improve logging and add stream handling for simulated push notifications
…mode

- Change the delay from 3 to 10 seconds for in-app notifications in demo mode
- This modification helps frontend developers by providing more time to
- observe and test the notification flow
- Remove foreground notification handling feature
- Add integrated notification center feature with subtle in-app indicator and unread count
- Improve description for better clarity
@fulleni fulleni added this to the Market Contender Edition milestone Nov 20, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @fulleni, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a significant new feature: an in-app notification center. This central hub allows users to browse their notification history, categorized into 'Breaking News' and 'Digests'. It provides functionality to mark notifications as read, both individually and in bulk, and integrates seamlessly with the application's global state to provide real-time unread indicators. The underlying push notification services have been enhanced to support this new in-app experience, including a simulation for demo environments to ensure a consistent user journey.

Highlights

  • New Feature: In-App Notification Center: Introduced a comprehensive in-app notification center, allowing users to view and manage their notifications directly within the application. This includes a dedicated UI with categorized tabs for 'Breaking News' and 'Digests'.
  • Notification Management: Users can now mark individual notifications as read or mark all unread notifications as read. The application's global state is updated to reflect unread notification counts, displaying an indicator on the account page.
  • BLoC Implementation: A new InAppNotificationCenterBloc has been added to manage the state of the notification center, handling data fetching, read/unread status updates, and tab navigation. It integrates with the main AppBloc to synchronize global unread indicators.
  • Foreground Notification Handling: Foreground push notifications are now captured and persisted as in-app notifications, ensuring users can access them later in the notification center. In demo mode, a simulated foreground notification is triggered upon user login.
  • Localization and UI Updates: New localization strings have been added for the notification center's various states and labels. The account page UI has been updated to include a navigation tile for the notification center with an unread indicator, and some existing tile labels have been refined.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a well-structured in-app notification center, a significant feature enhancement. The implementation spans across the BLoC, UI, routing, and services layers, and is generally of high quality. I've identified a critical issue in the new notification BLoC that could lead to a crash, and a medium-severity issue related to ID generation for notifications. I've provided detailed feedback and code suggestions for these points to improve the robustness of the new feature. The rest of the changes, including dependency injection updates, routing, and UI components, are well-implemented.

- Use firstWhereOrNull instead of firstWhere to safely handle null case
- Add logging for attempted markAsRead on non-existent notification
- Prevent exception by returning early if notification is not found
- Remove unnecessary import of dart:math
- Add uuid package to dependencies
- Update InAppNotification ID generation to use UUID instead of random number
- Add Uuid as a dependency in AppBloc constructor
- Move BlocProvider from InAppNotificationCenterPage to router
- Ensure InAppNotificationCenterBloc is available in BuildContext
  when InAppNotificationCenterPage's initState runs
- Refactor InAppNotificationCenterPage widget build
- Prioritize 'notificationType' from the backend over 'contentType'
- Explicitly check for 'dailyDigest' and 'weeklyRoundup' notification types
- Maintain existing behavior for breaking news and headline content
- Remove Uuid dependency from AppBloc
- Remove notification persistence logic from push notification handler
- Update comment to reflect new backend responsibility for notification persistence
…from a deep-link

- Implement new event InAppNotificationCenterMarkOneAsRead
- Add new handler _onMarkOneAsRead in InAppNotificationCenterBloc
- Extract shared logic to _markOneAsRead helper method
- Update imports to follow package order
- Add handling for 'notificationId' in notification payload
- Use pushNamed instead of goNamed for navigation to ensure correct context
- Pass 'notificationId' as extra data when navigating to article details
- Add notificationId parameter to HeadlineDetailsPage
- Mark in-app notification as read when navigating from a push notification
- Import InAppNotificationCenterBloc for handling notification state
- Add support for push notification deep-links in account and global article details routes
- Improve type safety for route 'extra' parameters
- Refactor BlocProvider creations for better readability
- Extract common provider setup for entity and headline details pages
- Align the NoOp service's behavior with the backend architecture
- Persist notification in the in-memory repository before emitting the push payload
- This change ensures a more accurate simulation of the real push notification process
- Update core dependency in pubspec.yaml and pubspec.lock
- Change ref from f409be2 to b01f9b4 in both files
@fulleni
Copy link
Member Author

fulleni commented Nov 20, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a full-featured in-app notification center, a significant enhancement to user engagement. The implementation is solid, with a new BLoC to manage notification state, a well-structured UI, and updates to the routing and dependency injection to support the feature. The handling of foreground notifications and deep-linking is well thought out. My review includes a couple of suggestions to improve the robustness of payload data handling by using safer type casting and avoiding magic strings, which will make the code more resilient and maintainable.

@fulleni fulleni merged commit bde96de into main Nov 20, 2025
0 of 2 checks passed
@fulleni fulleni deleted the feat/in-app-notification-center branch November 20, 2025 23:07
@github-project-automation github-project-automation bot moved this from Backlog to Done in Flutter News App Project Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants