Skip to content

Commit

Permalink
Merge pull request #103 from GetStream/feature/separatorBuilder
Browse files Browse the repository at this point in the history
Feature/separator builder
  • Loading branch information
imtoori authored Oct 15, 2020
2 parents 10dfbbd + 8331816 commit 2205b7f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.2.10

- Update llc dependency
- Add `separatorBuilder` to `ChannelListView`

## 0.2.9+1

- Update llc dependency
Expand Down
7 changes: 7 additions & 0 deletions lib/src/channel_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class ChannelListView extends StatefulWidget {
this.onChannelLongPress,
this.channelWidget,
this.channelPreviewBuilder,
this.separatorBuilder,
this.errorBuilder,
this.onImageTap,
this.pullToRefresh = true,
Expand Down Expand Up @@ -106,6 +107,9 @@ class ChannelListView extends StatefulWidget {
/// Builder used to create a custom channel preview
final ChannelPreviewBuilder channelPreviewBuilder;

/// Builder used to create a custom item separator
final Function(BuildContext, int) separatorBuilder;

/// The function called when the image is tapped
final Function(Channel) onImageTap;

Expand Down Expand Up @@ -266,6 +270,9 @@ class _ChannelListViewState extends State<ChannelListView>

Widget _itemBuilder(context, int i, List<Channel> channels) {
if (i % 2 != 0) {
if (widget.separatorBuilder != null) {
return widget.separatorBuilder(context, i);
}
return _separatorBuilder(context, i);
}

Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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.9+1
version: 0.2.10
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues

Expand All @@ -23,7 +23,7 @@ dependencies:
file_picker: ^2.0.0
image_picker: ^0.6.7+2
flutter_keyboard_visibility: ^3.2.1
stream_chat: ^0.2.7+1
stream_chat: ^0.2.8
mime: ^0.9.6+3
visibility_detector: ^0.1.5
http_parser: ^3.1.4
Expand Down

0 comments on commit 2205b7f

Please sign in to comment.