Skip to content

Commit f92da45

Browse files
Update README.md
1 parent 1dae5b7 commit f92da45

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

docs/README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,38 @@ When an user hits a send button the app is going to send the data like in this d
113113
This are messages on the feed
114114
<img width="200" alt="1_en-GB" src="https://github.com/user-attachments/assets/89905bba-a95b-4bfc-8102-b87f7c6b01e9">
115115

116-
## Rendering on the feed
117-
The GenericFeed UI component is designed to display list with posts within a tabbed view. It includes a dynamic feed that updates in real-time with new content from a data provider. It allows users to scroll through different types of posts and it's loading very fast and smooth. This component integrates Flutter’s NestedScrollView to allow navigation between different feed views.
118-
119-
ScrollablePostsList and ScrollablePostsAndRepliesList Widgets render the lists of posts displayed within each tab. It's loading more posts when the user reaches the end.
116+
# Rendering on the feed
117+
The GenericFeed UI component is designed to display list with posts within a tabbed view. It includes a dynamic feed that updates in real-time with new content from a data provider. It allows users to scroll through different types of posts.
118+
119+
ScrollablePostsList and ScrollablePostsAndRepliesList Widgets render the lists of posts displayed within each tab. It's loading more posts when the user reaches the end. The feed’s state is managed by a GenericFeedState provider, which listens for updates from the getNotesProvider to get all posts. It handles the real-time updating of the feed through streams. It also handles and the integration of new posts into the feed. Below you can see the code how data is getting into the feed like described above.
120+
121+
122+
```Widget build(BuildContext context, ref) {
123+
final genericFeedStateP = ref.watch(genericFeedStateProvider(feedFilter));
124+
final genericFeedStateNoti =
125+
ref.read(genericFeedStateProvider(feedFilter).notifier);
126+
127+
return _BuildScrollablePostsList(
128+
itemCount: genericFeedStateP.timelineRootNotes.length + 1,
129+
itemBuilder: (context, index) {
130+
if (index == genericFeedStateP.timelineRootNotes.length) {
131+
if (genericFeedStateP.endOfRootNotes) {
132+
return NoMoreNotes();
133+
}
134+
return SkeletonNote(
135+
renderCallback: () {
136+
genericFeedStateNoti.loadMore();
137+
},
138+
);
139+
}
140+
return NoteCardContainer(
141+
key: PageStorageKey(genericFeedStateP.timelineRootNotes[index].id),
142+
note: genericFeedStateP.timelineRootNotes[index],
143+
);
144+
},
145+
);
146+
}```
120147
121-
The feed’s state is managed by a GenericFeedState provider, which listens for updates from the getNotesProvider to get all posts. It handles the real-time updating of the feed through streams. It also handles and the integration of new posts into the feed.
122148
123149
# 6. Navigation and Routes
124150

0 commit comments

Comments
 (0)