Merge pull request #103 from GetStream/feature/separatorBuilder
Feature/separator builder
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
## 0.2.10
|
||||||
|
|
||||||
|
- Update llc dependency
|
||||||
|
- Add `separatorBuilder` to `ChannelListView`
|
||||||
|
|
||||||
## 0.2.9+1
|
## 0.2.9+1
|
||||||
|
|
||||||
- Update llc dependency
|
- Update llc dependency
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class ChannelListView extends StatefulWidget {
|
|||||||
this.onChannelLongPress,
|
this.onChannelLongPress,
|
||||||
this.channelWidget,
|
this.channelWidget,
|
||||||
this.channelPreviewBuilder,
|
this.channelPreviewBuilder,
|
||||||
|
this.separatorBuilder,
|
||||||
this.errorBuilder,
|
this.errorBuilder,
|
||||||
this.onImageTap,
|
this.onImageTap,
|
||||||
this.pullToRefresh = true,
|
this.pullToRefresh = true,
|
||||||
@@ -106,6 +107,9 @@ class ChannelListView extends StatefulWidget {
|
|||||||
/// Builder used to create a custom channel preview
|
/// Builder used to create a custom channel preview
|
||||||
final ChannelPreviewBuilder channelPreviewBuilder;
|
final ChannelPreviewBuilder channelPreviewBuilder;
|
||||||
|
|
||||||
|
/// Builder used to create a custom item separator
|
||||||
|
final Function(BuildContext, int) separatorBuilder;
|
||||||
|
|
||||||
/// The function called when the image is tapped
|
/// The function called when the image is tapped
|
||||||
final Function(Channel) onImageTap;
|
final Function(Channel) onImageTap;
|
||||||
|
|
||||||
@@ -266,6 +270,9 @@ class _ChannelListViewState extends State<ChannelListView>
|
|||||||
|
|
||||||
Widget _itemBuilder(context, int i, List<Channel> channels) {
|
Widget _itemBuilder(context, int i, List<Channel> channels) {
|
||||||
if (i % 2 != 0) {
|
if (i % 2 != 0) {
|
||||||
|
if (widget.separatorBuilder != null) {
|
||||||
|
return widget.separatorBuilder(context, i);
|
||||||
|
}
|
||||||
return _separatorBuilder(context, i);
|
return _separatorBuilder(context, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
name: stream_chat_flutter
|
name: stream_chat_flutter
|
||||||
homepage: https://github.com/GetStream/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.
|
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
|
repository: https://github.com/GetStream/stream-chat-flutter
|
||||||
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ dependencies:
|
|||||||
file_picker: ^2.0.0
|
file_picker: ^2.0.0
|
||||||
image_picker: ^0.6.7+2
|
image_picker: ^0.6.7+2
|
||||||
flutter_keyboard_visibility: ^3.2.1
|
flutter_keyboard_visibility: ^3.2.1
|
||||||
stream_chat: ^0.2.7+1
|
stream_chat: ^0.2.8
|
||||||
mime: ^0.9.6+3
|
mime: ^0.9.6+3
|
||||||
visibility_detector: ^0.1.5
|
visibility_detector: ^0.1.5
|
||||||
http_parser: ^3.1.4
|
http_parser: ^3.1.4
|
||||||
|
|||||||
Reference in New Issue
Block a user