Skip to content

Commit 5c279f7

Browse files
committed
fix(account): allow null values for notification cursors and error
- Update InAppNotificationCenterState to handle null values for notification cursors - Enable explicit setting of error to null - Use nullable wrapper for breakingNewsCursor and digestCursor - Allow redundant argument value for error to support null assignment
1 parent 1740bb9 commit 5c279f7

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

lib/account/bloc/in_app_notification_center_state.dart

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,30 @@ class InAppNotificationCenterState extends Equatable {
9191
List<InAppNotification>? breakingNewsNotifications,
9292
List<InAppNotification>? digestNotifications,
9393
bool? breakingNewsHasMore,
94-
String? breakingNewsCursor,
94+
// Use a nullable wrapper to explicitly set the cursor to null.
95+
Object? breakingNewsCursor,
9596
bool? digestHasMore,
96-
String? digestCursor,
97+
Object? digestCursor,
9798
}) {
9899
return InAppNotificationCenterState(
99100
status: status ?? this.status,
100-
error: error ?? this.error,
101+
// Allow explicitly setting the error to null.
102+
// ignore: avoid_redundant_argument_values
103+
error: error,
101104
currentTabIndex: currentTabIndex ?? this.currentTabIndex,
102105
breakingNewsNotifications:
103106
breakingNewsNotifications ?? this.breakingNewsNotifications,
104107
digestNotifications: digestNotifications ?? this.digestNotifications,
105108
breakingNewsHasMore: breakingNewsHasMore ?? this.breakingNewsHasMore,
106-
breakingNewsCursor: breakingNewsCursor ?? this.breakingNewsCursor,
109+
breakingNewsCursor: breakingNewsCursor == null
110+
? this
111+
.breakingNewsCursor // No change
112+
: breakingNewsCursor as String?, // New value
107113
digestHasMore: digestHasMore ?? this.digestHasMore,
108-
digestCursor: digestCursor ?? this.digestCursor,
114+
digestCursor: digestCursor == null
115+
? this
116+
.digestCursor // No change
117+
: digestCursor as String?, // New value
109118
);
110119
}
111120
}

0 commit comments

Comments
 (0)