File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
sample_app/lib/screens/home/widgets Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,10 @@ class _UserFeedViewState extends State<UserFeedView> {
103103 _onCommentClick (context, activity),
104104 onHeartClick: (isAdding) =>
105105 _onHeartClick (activity, isAdding),
106- onRepostClick: (message) {},
107- onBookmarkClick: () {},
106+ onRepostClick: (message) =>
107+ _onRepostClick (context, activity, message),
108+ onBookmarkClick: () =>
109+ _onBookmarkClick (context, activity),
108110 onDeleteClick: () {},
109111 onEditSave: (text) {},
110112 ),
@@ -207,6 +209,19 @@ class _UserFeedViewState extends State<UserFeedView> {
207209 );
208210 }
209211 }
212+
213+ void _onRepostClick (
214+ BuildContext context, ActivityData activity, String ? message) {
215+ feed.repost (activityId: activity.id, text: message);
216+ }
217+
218+ void _onBookmarkClick (BuildContext context, ActivityData activity) {
219+ if (activity.ownBookmarks.isNotEmpty) {
220+ feed.deleteBookmark (activityId: activity.id);
221+ } else {
222+ feed.addBookmark (activityId: activity.id);
223+ }
224+ }
210225}
211226
212227class _FeedWidget extends StatelessWidget {
You can’t perform that action at this time.
0 commit comments