diff --git a/CHANGELOG.md b/CHANGELOG.md index d0054b2b..4844b83b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.2.1 + +- Better ui components +- Add read indicators +- Add system messages +- Use llc 0.2 +- Add `ChannelsBloc` widget to manage a list of channels with pagination + ## 0.2.1-alpha+11 - Update llc dependency diff --git a/README.md b/README.md index 9049b4c0..16af889f 100644 --- a/README.md +++ b/README.md @@ -33,19 +33,11 @@ The example is available under the [example](https://github.com/GetStream/stream ```yaml dependencies: - stream_chat_flutter: ^0.1.19 + stream_chat_flutter: ^0.2.0 ``` You should then run `flutter packages get` -### Alpha version - -Use version `^0.2.0-alpha+2` to use the latest available version. - -Note that this is still an alpha version. There may be some bugs, and the API can change in breaking ways. - -Thanks to whoever tries these versions and reports bugs or suggestions. - ### Android All set ✅ @@ -86,6 +78,7 @@ Every widget uses the `StreamChat` or `StreamChannel` widgets to manage the stat - [MessageWidget](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/MessageWidget-class.html) - [StreamChatTheme](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamChatTheme-class.html) - [ThreadHeader](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/ThreadHeader-class.html) +- ... ### Customizing styles @@ -109,14 +102,13 @@ Out of the box, all chat widgets use their default styling, and there are two wa return MaterialApp( theme: theme, - home: Container( - child: StreamChat( - streamChatThemeData: StreamChatThemeData.fromTheme(theme), - client: client, - child: ChannelListPage(), - ), + builder: (context, child) => StreamChat( + child: child, + client: client, + streamChatThemeData: StreamChatThemeData.fromTheme(theme), ), - ); + home: ChannelListPage(), + ); } } ``` @@ -136,24 +128,23 @@ Out of the box, all chat widgets use their default styling, and there are two wa return MaterialApp( theme: theme, - home: Container( - child: StreamChat( - streamChatThemeData: StreamChatThemeData.fromTheme(theme).copyWith( - ownMessageTheme: MessageTheme( - messageBackgroundColor: Colors.black, - messageText: TextStyle( - color: Colors.white, - ), - avatarTheme: AvatarTheme( - borderRadius: BorderRadius.circular(8), - ), - ), + builder: (context, child) => StreamChat( + child: child, + client: client, + streamChatThemeData: StreamChatThemeData.fromTheme(theme).copyWith( + ownMessageTheme: MessageTheme( + messageBackgroundColor: Colors.black, + messageText: TextStyle( + color: Colors.white, ), - client: client, - child: ChannelListPage(), - ), + avatarTheme: AvatarTheme( + borderRadius: BorderRadius.circular(8), + ), + ), + ), ), - ); + home: ChannelListPage(), + ); } } ``` diff --git a/example/lib/customize_channel_preview.dart b/example/lib/customize_channel_preview.dart index 55da346c..3809f780 100644 --- a/example/lib/customize_channel_preview.dart +++ b/example/lib/customize_channel_preview.dart @@ -59,7 +59,7 @@ class ChannelListPage extends StatelessWidget { filter: { 'members': { '\$in': [StreamChat.of(context).user.id], - }, + } }, channelPreviewBuilder: _channelPreviewBuilder, sort: [SortOption('last_message_at')], @@ -73,17 +73,18 @@ class ChannelListPage extends StatelessWidget { } Widget _channelPreviewBuilder(BuildContext context, Channel channel) { - final lastMessage = channel.state.messages.reversed.firstWhere( - (message) => message.type != 'deleted', - orElse: () => null, - ); + final lastMessage = channel.state.messages.reversed + .firstWhere((message) => !message.isDeleted); - final subtitle = (lastMessage == null ? 'nothing yet' : lastMessage.text); + final subtitle = (lastMessage == null ? "nothing yet" : lastMessage.text); final opacity = channel.state.unreadCount > .0 ? 1.0 : 0.5; return ListTile( - leading: ChannelImage(), + leading: ChannelImage( + channel: channel, + ), title: ChannelName( + channel: channel, textStyle: StreamChatTheme.of(context).channelPreviewTheme.title.copyWith( color: Colors.black.withOpacity(opacity), diff --git a/lib/src/channel_header.dart b/lib/src/channel_header.dart index 26668697..5a7a146c 100644 --- a/lib/src/channel_header.dart +++ b/lib/src/channel_header.dart @@ -157,6 +157,9 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget { child: Icon( Icons.arrow_back_ios, size: 15, + color: Theme.of(context).brightness == Brightness.dark + ? Colors.white + : Colors.black, ), ), ); diff --git a/pubspec.yaml b/pubspec.yaml index 77840411..249d83b3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,9 @@ name: stream_chat_flutter homepage: https://github.com/GetStream/stream-chat-flutter description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter. -version: 0.2.1-alpha+11 +version: 0.2.1 +repository: https://github.com/GetStream/stream-chat-flutter +issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues environment: sdk: ">=2.3.0 <3.0.0" @@ -21,7 +23,7 @@ dependencies: file_picker: ^1.12.0 image_picker: ^0.6.7+2 flutter_keyboard_visibility: ^3.2.1 - stream_chat: ^0.2.0-alpha+23 + stream_chat: ^0.2.0 mime: ^0.9.6+3 visibility_detector: ^0.1.5 http_parser: ^3.1.4