File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ command:
4040 state_notifier : ^1.0.0
4141 uuid : ^4.5.1
4242
43+ # TODO Replace with hosted version when published
4344 stream_core :
4445 git :
4546 url : https://github.com/GetStream/stream-core-flutter.git
Original file line number Diff line number Diff line change @@ -298,7 +298,8 @@ extension ThreadedCommentDataMutations on ThreadedCommentData {
298298 ThreadedCommentData reply,
299299 Comparator <CommentsSortDataFields > comparator,
300300 ) {
301- final updatedReplies = (replies ?? []).sortedUpsert (
301+ final currentReplies = replies ?? [];
302+ final updatedReplies = currentReplies.sortedUpsert (
302303 reply,
303304 key: (it) => it.id,
304305 compare: comparator,
@@ -315,7 +316,10 @@ extension ThreadedCommentDataMutations on ThreadedCommentData {
315316 /// @param comment The reply comment to remove.
316317 /// @return A new [ThreadedCommentData] instance with the updated replies and reply count.
317318 ThreadedCommentData removeReply (ThreadedCommentData reply) {
318- final updatedReplies = replies? .where ((it) => it.id != reply.id).toList ();
319+ final currentReplies = replies ?? [];
320+ final updatedReplies = currentReplies.where ((it) {
321+ return it.id != reply.id;
322+ }).toList ();
319323
320324 return copyWith (
321325 replies: updatedReplies,
@@ -331,7 +335,8 @@ extension ThreadedCommentDataMutations on ThreadedCommentData {
331335 ThreadedCommentData reply,
332336 Comparator <CommentsSortDataFields > comparator,
333337 ) {
334- final updatedReplies = replies? .sortedUpsert (
338+ final currentReplies = replies ?? [];
339+ final updatedReplies = currentReplies.sortedUpsert (
335340 reply,
336341 key: (it) => it.id,
337342 compare: comparator,
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ dependencies:
3333 retrofit : ^4.6.0
3434 rxdart : ^0.28.0
3535 state_notifier : ^1.0.0
36- # TODO Replace with hosted version when published
3736 stream_core :
3837 git :
3938 url : https://github.com/GetStream/stream-core-flutter.git
You can’t perform that action at this time.
0 commit comments