Releases: GetStream/stream-feed-flutter
v0.8.0
stream_feed
0.6.0
Changelog
- new: aggregatedFeed.
getEnrichedActivityDetailand aggregatedFeed.getPaginatedActivities - new:
PaginatedActivitiesGroupmodel - fix:
setUsernow take the data field ofUserif provided - enhancement/breaking: make the constructor parameters of
PaginatedReactionsnamed
stream_feed_flutter_core
0.8.0
Changelog
- bump llc: fix:
setUsernot usinguser.dataon user create. - new:
FeedBlocandGenericFeedBlocnow havequeryPaginatedEnrichedActivities,loadMoreEnrichedActivities, andpaginatedParamsto 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:
GenericFlatFeedCoreandFlatFeedCorenow callsqueryPaginatedEnrichedActivitieson initial load. - fix/breaking:
onAddChildReactioncommenting on a comment is now reactive but we had to remove theactivityparameter 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
v0.7.0+1
stream_feed_flutter_core
0.7.0+1
Changelog
- fixes(FeedBloc):
- bug when adding to a fix lengthed list
- change the init behavior of queryEnrichedActivities (to allow it to be called again)
v0.7.0
faye_dart
0.1.1+1
Changelog
- FIX: implement Equatable on
FayeClient. With this change, if you fetch your client from anInheritedWidgetfor example,updateShouldNotifydoesn't trigger every time. - NEW: expose connexion status stream
Stream<FayeClientState>via theSubscriptionclass to check if the Faye client is unconnected, connecting, connected or disconnected, and act accordingly.
stream_feed
0.5.1
Changelog
- UPSTREAM(realtime): version bump. You can now listen to connexion status in the
Subscriptionclass. For example:
final subscription = await feed.subscribe();
final subscriptionStatus = subscription.stateStream;- NEW(realtime): you can now adjust log level when subscribing
- FIX: implement Equatable on
StreamFeedClient. With this change, if you fetch your client from anInheritedWidgetfor example,updateShouldNotifydoesn't trigger every time.
stream_feed_flutter_core
0.7.0
Changelog
- FIX:
FeedProviderinherited widget had an issue with theupdateShouldNotifybeing triggered everytime. This has been fixed via the llc, being bumped to 0.5.1. - UPSTREAM(realtime): version bump
- BREAKING:
onAddActivitysignature changed. The named parameterdatachanged 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
AnAttachmentmodel to convert aMediaUriTO aMap<String, Object?>to send as an
extraDataalong 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()v0.6.0
stream_feed
0.5.0
Changelog
- BREAKING: 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
StreamFeedClientat the top of your widget tree for example, and connect 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,
+ );stream_feed_flutter_core
0.6.0
Changelog
- breaking: bump version of breaking change llc
v0.5.0
stream_feed
0.4.0+3
Changelog
- fix: call profile in setUser, so that currentUser data is not null
stream_feed_flutter_core
0.5.0
Changelog
- fix: the convenient typedefs on generic classes we provided was breaking autocomplete
- breaking: we renamed some methods
followFlatFeed->followFeedunfollowFlatFeed->unfollowFeedisFollowingUser->isFollowingFeed
- fix: export MediaUri
- new: add scrollPhysics parameter to
ReactionListCore
v0.4.1
stream_feed
0.4.0+2
Changelog
- fix: export image_storage_client.dart
stream_feed_flutter_core
0.4.1
Changelog
- new: UploadListCore and UploadController
Uploads are at the heart of feeds applications so we made this convenient classes to help you manage the state of media uploads (fail, progress, success, cancel) in your Stream's powered app
Usage :
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:stream_feed_flutter_core/stream_feed_flutter_core.dart';
....
class ComposeScreen extends StatefulWidget {
const ComposeScreen({Key? key}) : super(key: key);
@override
State<ComposeScreen> createState() => _ComposeScreenState();
}
class _ComposeScreenState extends State<ComposeScreen> {
late AttachmentFile? _file = null;
@override
Widget build(BuildContext context) {
final uploadController = FeedProvider.of(context).bloc.uploadController;
return Scaffold(
appBar: AppBar(title: const Text('Compose'), actions: [
Padding(
padding: const EdgeInsets.all(8.0),
child: ActionChip(
label: const Text(
'Post',
style: TextStyle(
color: Colors.blue,
),
),
backgroundColor: Colors.white,
onPressed: () {
final attachments = uploadController.getMediaUris();
print(attachments);
uploadController.clear();
}),
)
]),
body: SingleChildScrollView(
child: Column(children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: TextField(
decoration: InputDecoration(hintText: "this is a text field"),
),
),
IconButton(
onPressed: () async {
final ImagePicker _picker = ImagePicker();
final XFile? image =
await _picker.pickImage(source: ImageSource.gallery);
if (image != null) {
await FeedProvider.of(context)
.bloc
.uploadController
.uploadImage(AttachmentFile(path: image.path));
} else {
// User canceled the picker
}
},
icon: Icon(Icons.file_copy)),
UploadListCore(
uploadController: FeedProvider.of(context).bloc.uploadController,
uploadsBuilder: (context, uploads) {
return SizedBox(
height: 100,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: uploads.length,
itemBuilder: (context, index) => FileUploadStateWidget(
fileState: uploads[index],
onRemoveUpload: (attachment) {
return uploadController.removeUpload(attachment);
},
onCancelUpload: (attachment) {
uploadController.cancelUpload(attachment);
},
onRetryUpload: (attachment) async {
return uploadController.uploadImage(attachment);
}),
),
);
},
),
])),
);
}
}0.4.0+1
stream_feed
0.4.0+1
Changelog
- fix: support null values
extraData's map - fix: utc date parsing with a
JsonConverter<DateTime,String>andintl - fix: unread/unseen count in
NotificationFeedMetamodel
stream_feed_flutter_core
0.4.0+1
Changelog
- Use secure link in readme
- version bump llc
- barebone core sample app to get you started
v0.4.0
stream_feed
0.4.0
Changelog
- breaking:
StreamFeedClient.connectis nowStreamFeedClientfor better user session handling.
The connect verb was confusing, and made you think that it will perform the connection immediately. Also, it doesn't infer the id anymore from the token anymore. You can now have to callsetUserdown the tree or beforerunApp - breaking:
setUsernow takes aUser(must contain id) and a token. Passing the user token in the client constructor was making the whole instance depend on a single user. - new: we support generics
EnrichedActivityis nowGenericEnrichedActivity<A,Ob,T,Or>in order to have a more flexible API surface. Those generic parameters can be as follows:
A = [actor]: can be an User, String
Ob = [object] can a String, or a CollectionEntry
T = [target] can be a String or an Activity
Or = [origin] can be a String or a Reaction or a User - breaking: along with these changes we removed the
EnrichableFieldfield fromEnrichedActivity - new: there is a type definition
EnrichedActivityto handle most use cases ofGenericEnrichedActivity(User,String,String,String) - fix: a time drift issue in a token generation when using the low-level client sever-side
- bump: dart SDK package constraints to 2.14 to make use of typedefs for nonfunction types
stream_feed_flutter_core
0.4.0
First Release of Core 🎉
This package provides business logic to fetch common things required for integrating Stream Feed into your application.
The core package allows more customization and hence provides business logic but no UI components.
Use stream_feed for the low-level client.
The package primarily contains three types of classes:
- Business Logic Components
- Core Components
Business Logic Components
These components allow you to have the maximum and lower-level control of the queries being executed.
The BLoCs we provide are:
- FeedBloc
Core Components
Core components usually are an easy way to fetch data associated with Stream Feed which are decoupled from UI and often expose UI builders.
Data fetching can be controlled with the controllers of the respective core components.
- FlatFeedCore (Fetch a list of activities)
- ReactionListCore (Fetch a list of reactions)
- FeedProvider (Inherited widget providing FeedBloc to the widget tree)
Usage
import 'package:flutter/material.dart';
import 'package:stream_feed_flutter_core/stream_feed_flutter_core.dart';
void main() {
const apiKey = 'API-KEY';
const userToken = 'USER-TOKEN';
final client = StreamFeedClient(
apiKey,
token: const Token(userToken),
);
runApp(
MaterialApp(
/// Wrap your application in a `FeedProvider`. This requires a `FeedBloc`.
/// The `FeedBloc` is used to perform various Stream Feed operations.
builder: (context, child) => FeedProvider(
bloc: FeedBloc(client: client),
child: child!,
),
home: Scaffold(
/// Returns `Activities`s for the given `feedGroup` in the `feedBuilder`.
body: FlatFeedCore(
feedGroup: 'user',
feedBuilder: (BuildContext context, activities, int index) {
return InkWell(
child: Column(children: [
Text("${activities[index].actor}"),
Text("${activities[index].object}"),
]),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (BuildContext context) => Scaffold(
/// Returns `Reaction`s for the given
/// `lookupValue` in the `reactionsBuilder`.
body: ReactionListCore(
lookupValue: activities[index].id!,
reactionsBuilder: (context, reactions, idx) =>
Text("${reactions[index].data?["text"]}"),
),
),
),
);
},
);
},
),
),
),
);
}v0.3.0
- improvements:
- docs
- better error handling and expose exception type
- const constructors when possible
- breaking:
UserClient user(String userId)is nowStreamUser user(String userId)for easier state management - breaking: change type of
Reactionmodel fielduserfromMap<String,dynamic>toUser - new: serverside methods for CRUD operations on User(getUser, createUser, updateUser, deleteUser)
- new:
CancelToken,OnSendProgressnamed parameters to support cancelling an upload and tracking its progress - new: logger options to allow choosing the Logger level
- fix: missing field
ownChildreninReactionmodel - new: allow sending enrichment flags in
filtermehod - new: createReactionReference
v0.2.3
Nothing new: fixing dead links in Readmes