Skip to content

Releases: GetStream/stream-feed-flutter

v0.8.0

27 May 16:25
4c4a51f
Compare
Choose a tag to compare
v0.8.0 Pre-release
Pre-release

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

v0.7.0+1

28 Feb 20:03
cb2e051
Compare
Choose a tag to compare
v0.7.0+1 Pre-release
Pre-release

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

25 Feb 22:10
dd139b0
Compare
Choose a tag to compare
v0.7.0 Pre-release
Pre-release

faye_dart

0.1.1+1

Changelog

  • FIX: implement Equatable on FayeClient. With this change, if you fetch your client from an InheritedWidget for example, updateShouldNotify doesn't trigger every time.
  • NEW: expose connexion status stream Stream<FayeClientState> via the Subscription class 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 Subscription class. 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 an InheritedWidget for example, updateShouldNotify doesn't trigger every time.

stream_feed_flutter_core

0.7.0

Changelog

  • FIX: FeedProvider inherited widget had an issue with the updateShouldNotify being triggered everytime. This has been fixed via the llc, being bumped to 0.5.1.
  • UPSTREAM(realtime): version bump
  • BREAKING: onAddActivity signature changed. The named parameter datachanged from Map<String, String>? to Map<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
    An Attachment model to convert a MediaUri TO a Map<String, Object?> to send as an
    extraData 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()

v0.6.0

12 Jan 14:46
394506e
Compare
Choose a tag to compare
v0.6.0 Pre-release
Pre-release

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 StreamFeedClient at 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

27 Dec 20:25
3f8ab8c
Compare
Choose a tag to compare
v0.5.0 Pre-release
Pre-release

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 -> followFeed
    • unfollowFlatFeed -> unfollowFeed
    • isFollowingUser -> isFollowingFeed
  • fix: export MediaUri
  • new: add scrollPhysics parameter to ReactionListCore

v0.4.1

22 Dec 12:44
d3b87a6
Compare
Choose a tag to compare
v0.4.1 Pre-release
Pre-release

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

07 Dec 14:36
3f6b93d
Compare
Choose a tag to compare
0.4.0+1 Pre-release
Pre-release

stream_feed

0.4.0+1

Changelog

  • fix: support null values extraData's map
  • fix: utc date parsing with a JsonConverter<DateTime,String> and intl
  • fix: unread/unseen count in NotificationFeedMeta model

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

29 Oct 21:13
de915c0
Compare
Choose a tag to compare
v0.4.0 Pre-release
Pre-release

stream_feed

0.4.0

Changelog

  • breaking: StreamFeedClient.connect is now StreamFeedClient for 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 call setUser down the tree or before runApp
  • breaking: setUser now takes a User (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
    EnrichedActivity is now GenericEnrichedActivity<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 EnrichableField field from EnrichedActivity
  • new: there is a type definition EnrichedActivity to handle most use cases of GenericEnrichedActivity (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:

  1. Business Logic Components
  2. 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:

  1. 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.

  1. FlatFeedCore (Fetch a list of activities)
  2. ReactionListCore (Fetch a list of reactions)
  3. 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

06 Sep 13:29
e16110d
Compare
Choose a tag to compare
v0.3.0 Pre-release
Pre-release
  • improvements:
    • docs
    • better error handling and expose exception type
    • const constructors when possible
  • breaking: UserClient user(String userId) is now StreamUser user(String userId) for easier state management
  • breaking: change type of Reaction model field user from Map<String,dynamic> to User
  • new: serverside methods for CRUD operations on User(getUser, createUser, updateUser, deleteUser)
  • new: CancelToken, OnSendProgress named parameters to support cancelling an upload and tracking its progress
  • new: logger options to allow choosing the Logger level
  • fix: missing field ownChildren in Reaction model
  • new: allow sending enrichment flags in filter mehod
  • new: createReactionReference

v0.2.3

03 Aug 20:20
242d34c
Compare
Choose a tag to compare
v0.2.3 Pre-release
Pre-release

Nothing new: fixing dead links in Readmes