File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
lib/shared/widgets/feed_core Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
44import 'package:flutter_bloc/flutter_bloc.dart' ;
55import 'package:flutter_news_app_mobile_client_full_source_code/ads/services/interstitial_ad_manager.dart' ;
66import 'package:flutter_news_app_mobile_client_full_source_code/app/bloc/app_bloc.dart' ;
7+ import 'package:ui_kit/ui_kit.dart' ;
78import 'package:url_launcher/url_launcher_string.dart' ;
89
910/// {@template headline_tap_handler}
@@ -97,10 +98,18 @@ abstract final class HeadlineTapHandler {
9798 ///
9899 /// - [context] : The current [BuildContext] to access BLoCs and for navigation.
99100 /// - [headlineId] : The ID of the [Headline] item that was tapped.
101+ /// - [notificationId] : The optional ID of the notification itself, used to
102+ /// mark it as read.
100103 static Future <void > handleTapFromSystemNotification (
101104 BuildContext context,
102- String headlineId,
103- ) async {
105+ String headlineId, {
106+ String ? notificationId,
107+ }) async {
108+ // If a notificationId is provided, dispatch an event to mark it as read.
109+ if (notificationId != null ) {
110+ context.read <AppBloc >().add (AppNotificationTapped (notificationId));
111+ }
112+
104113 if (context.mounted) {
105114 showDialog <void >(
106115 context: context,
You can’t perform that action at this time.
0 commit comments