stream_feed_flutter_core 0.8.0
stream_feed_flutter_core: ^0.8.0 copied to clipboard
Stream Feed official Flutter SDK Core. Build your own feed experience using Dart and Flutter.
0.8.0 #
- bump llc: fix:
setUser
not usinguser.data
on user create. - new:
FeedBloc
andGenericFeedBloc
now havequeryPaginatedEnrichedActivities
,loadMoreEnrichedActivities
, andpaginatedParams
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
andFlatFeedCore
now callsqueryPaginatedEnrichedActivities
on initial load. - fix/breaking:
onAddChildReaction
commenting on a comment is now reactive but we had to remove theactivity
parameter and replace it withlookupValue
. 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
0.7.0+1 28/02/2022 #
- fixes(FeedBloc):
- bug when adding to a fix lengthed list
- change the init behavior of queryEnrichedActivities (to allow it to be called again)
0.7.0 25/02/2022 #
- fix:
FeedProvider
inherited widget had an issue with theupdateShouldNotify
being triggered everytime. This has been fixed via the llc, being bumped to 0.5.1. - realtime: version bump. You can now listen to connexion status in the
Subscription
class. For example:
final subscription = await feed.subscribe();
final subscriptionStatus = subscription.stateStream;
- BREAKING:
onAddActivity
signature changed. The named parameterdata
changed fromMap<String, String>?
toMap<String, Object>?
. - BREAKING: Refactors all of our builder methods to return data and not be opinionated about widgets in Core package new: Various additional code documentation added
- NEW: new model and convenient extensions for the
UploadController
AnAttachment
model to convert aMediaUri
TO aMap<String, Object?>
to send as anextraData
along an activity or a reaction. For example:
final bloc = FeedProvider.of(context).bloc;
final uploadController = bloc.uploadController;
final extraData = uploadController.getMediaUris()?.toExtraData();
await bloc.onAddReaction( kind: 'comment', data: extraData, activity: parentActivity, feedGroup: feedGroup );
The attachment model is also useful to convert FROM extraData in an activity or reaction via the toAttachments
extension. For example:
final attachments = activity.extraData?.toAttachments()
0.6.0: 12/01/2022 #
- BREAKING: bumped llc to 0.5.0, which is a breaking change. We no longer accept a token in the constructor. This change is inspired by Stream Chat, and allows for use cases like multi account management. It allows to instantiate
StreamFeedClient
at the top of your widget tree for example, and connecting the user later.
- client = StreamFeedClient(apiKey, token: frontendToken);
+ client = StreamFeedClient(apiKey);
+
+ await client.setUser(
+ const User(
+ data: {
+ 'name': 'John Doe',
+ 'occupation': 'Software Engineer',
+ 'gender': 'male'
+ },
+ ),
+ frontendToken,
+ );
0.5.0: 27/12/2021 #
- fix: the convenient typedefs on generic classes we provided was breaking autocomplete
- breaking: we renamed some methods
followFlatFeed
->followFeed
unfollowFlatFeed
->unfollowFeed
isFollowingUser
->isFollowingFeed
- fix: export MediaUri
- new: add scrollPhysics parameter to
ReactionListCore
0.4.1: 22/12/2021 #
- new: UploadListCore and UploadController
0.4.0+1: 07/12/2021 #
- Use secure link in readme
- version bump llc
0.4.0: 29/10/2021 #
- first release