Skip to content

Commit 063c019

Browse files
committed
Revert "fix issue #165: Unread Messages count"
This reverts commit cdb28a8.
1 parent c5c412c commit 063c019

File tree

4 files changed

+43
-53
lines changed

4 files changed

+43
-53
lines changed

packages/stream_feed/lib/src/core/models/group.dart

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,16 @@ class Group<T> extends Equatable {
6262
@JsonSerializable(createToJson: true, genericArgumentFactories: true)
6363
class NotificationGroup<T> extends Group<T> {
6464
/// [NotificationGroup] constructor
65-
const NotificationGroup(
66-
{String? id,
67-
String? group,
68-
List<T>? activities,
69-
int? actorCount,
70-
DateTime? createdAt,
71-
DateTime? updatedAt,
72-
this.isRead,
73-
this.isSeen,
74-
this.unread,
75-
this.unseen})
76-
: super(
65+
const NotificationGroup({
66+
String? id,
67+
String? group,
68+
List<T>? activities,
69+
int? actorCount,
70+
DateTime? createdAt,
71+
DateTime? updatedAt,
72+
this.isRead,
73+
this.isSeen,
74+
}) : super(
7775
id: id,
7876
group: group,
7977
activities: activities,
@@ -95,11 +93,12 @@ class NotificationGroup<T> extends Group<T> {
9593
/// True if the notification group is seen.
9694
final bool? isSeen;
9795

98-
final int? unread;
99-
final int? unseen;
100-
10196
@override
102-
List<Object?> get props => [...super.props, isRead, isSeen, unread, unseen];
97+
List<Object?> get props => [
98+
...super.props,
99+
isRead,
100+
isSeen,
101+
];
103102

104103
/// Serialize to json
105104
@override

packages/stream_feed/lib/src/core/models/group.g.dart

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/stream_feed/test/fixtures/notification_group.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,5 @@
2828
"created_at": "2001-09-11T00:01:02.000",
2929
"updated_at": "2001-09-11T00:01:02.000",
3030
"is_read": true,
31-
"is_seen": true,
32-
"unread": 0,
33-
"unseen": 1
34-
}
31+
"is_seen": true
32+
}

packages/stream_feed/test/models_test.dart

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -429,32 +429,31 @@ void main() {
429429

430430
group('NotificationGroup', () {
431431
final notificationGroup = NotificationGroup(
432-
id: 'test',
433-
group: 'test',
434-
activities: [
435-
Activity(
436-
target: 'test',
437-
foreignId: 'test',
438-
id: 'test',
439-
analytics: const {'test': 'test'},
440-
extraContext: const {'test': 'test'},
441-
origin: 'test',
442-
score: 1,
443-
extraData: const {'test': 'test'},
444-
actor: 'test',
445-
verb: 'test',
446-
object: 'test',
447-
to: <FeedId>[FeedId('slug', 'id')],
448-
time: DateTime.parse('2001-09-11T00:01:02.000'),
449-
),
450-
],
451-
actorCount: 1,
452-
createdAt: DateTime.parse('2001-09-11T00:01:02.000'),
453-
updatedAt: DateTime.parse('2001-09-11T00:01:02.000'),
454-
isRead: true,
455-
isSeen: true,
456-
unread: 0,
457-
unseen: 1);
432+
id: 'test',
433+
group: 'test',
434+
activities: [
435+
Activity(
436+
target: 'test',
437+
foreignId: 'test',
438+
id: 'test',
439+
analytics: const {'test': 'test'},
440+
extraContext: const {'test': 'test'},
441+
origin: 'test',
442+
score: 1,
443+
extraData: const {'test': 'test'},
444+
actor: 'test',
445+
verb: 'test',
446+
object: 'test',
447+
to: <FeedId>[FeedId('slug', 'id')],
448+
time: DateTime.parse('2001-09-11T00:01:02.000'),
449+
),
450+
],
451+
actorCount: 1,
452+
createdAt: DateTime.parse('2001-09-11T00:01:02.000'),
453+
updatedAt: DateTime.parse('2001-09-11T00:01:02.000'),
454+
isRead: true,
455+
isSeen: true,
456+
);
458457

459458
test('fromJson', () {
460459
final notificationGroupJson =
@@ -491,9 +490,7 @@ void main() {
491490
'created_at': '2001-09-11T00:01:02.000',
492491
'updated_at': '2001-09-11T00:01:02.000',
493492
'is_read': true,
494-
'is_seen': true,
495-
'unread': 0,
496-
'unseen': 1,
493+
'is_seen': true
497494
});
498495
});
499496
});

0 commit comments

Comments
 (0)