Skip to content

v0.8.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@sachaarbonel sachaarbonel released this 27 May 16:25
· 5 commits to master since this release
4c4a51f

stream_feed

0.6.0

Changelog

  • new: aggregatedFeed.getEnrichedActivityDetail and aggregatedFeed.getPaginatedActivities
  • new: PaginatedActivitiesGroup model
  • fix: setUser now take the data field of User if provided
  • enhancement/breaking: make the constructor parameters of PaginatedReactions named

stream_feed_flutter_core

0.8.0

Changelog

  • bump llc: fix: setUser not using user.data on user create.
  • new: FeedBloc and GenericFeedBloc now have queryPaginatedEnrichedActivities, loadMoreEnrichedActivities, and paginatedParams to easily manage pagination.
class _CommentsPageState extends State<CommentsPage> {
  bool _isPaginating = false;
  
  Future<void> _loadMore() async {
    // Ensure we're not already loading more reactions.
    if (!_isPaginating) {
      _isPaginating = true;
      context.feedBloc
          .loadMoreReactions(widget.activity.id!, flags: _flags)
          .whenComplete(() {
        _isPaginating = false;
      });
    }
  }

  ...

  return ReactionListCore(
    reactionsBuilder: (context, reactions) =>
                 RefreshIndicator(
                    onRefresh: () {
                      return context.feedBloc.refreshPaginatedReactions(
                        widget.activity.id!,
                        flags: _flags,
                      );
                    },
                    child: ListView.separated(
                      itemCount: reactions.length,
                      separatorBuilder: (context, index) => const Divider(),
                      itemBuilder: (context, index) {
                        bool shouldLoadMore = reactions.length - 3 == index;
                        if (shouldLoadMore) {
                          _loadMore();
                        }
                        return ListReactionItem(reaction:reactions[index]);
                        }
                        ))
  );
  • changed: GenericFlatFeedCore and FlatFeedCore now calls queryPaginatedEnrichedActivities on initial load.
  • fix/breaking: onAddChildReaction commenting on a comment is now reactive but we had to remove the activity parameter and replace it with lookupValue. For example:
 FeedProvider.of(context).bloc.onAddChildReaction(
            kind: 'comment',
            reaction: reaction,
            lookupValue: widget.reaction.id!,
            data: {"text": "this is a comment on a comment"},
          );
  • docs: Stream Feed Core documentation and examples updated