Skip to content

Commit c42fae7

Browse files
committed
feat: implement onNewActivity callback for stories feed to add new activities to the end
1 parent 69adad1 commit c42fae7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sample_app/lib/screens/user_feed/user_feed_screen.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ class _UserFeedScreenState extends State<UserFeedScreen> {
3030

3131
late final storiesFeed = client.feedFromId(
3232
FeedId.stories(client.user.id),
33+
onNewActivity: (query, activity, currentUserId) {
34+
// By default new activities are added to the start of the list,
35+
// but this is not what we want for stories
36+
return InsertionAction.addToEnd;
37+
},
3338
);
3439

3540
late final userFeed = client.feedFromQuery(

0 commit comments

Comments
 (0)