Merge branch 'master' into feature/new-ui

This commit is contained in:
Salvatore Giordano
2020-10-23 16:29:04 +02:00
9 changed files with 67 additions and 42 deletions
+9 -4
View File
@@ -64,6 +64,7 @@ class ChannelListView extends StatefulWidget {
this.onChannelLongPress,
this.channelWidget,
this.channelPreviewBuilder,
this.separatorBuilder,
this.errorBuilder,
this.onImageTap,
this.swipeToAction = false,
@@ -113,6 +114,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;
@@ -273,6 +277,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);
}
@@ -304,10 +311,8 @@ class _ChannelListViewState extends State<ChannelListView>
return StreamChannel(
key: ValueKey<String>('CHANNEL-${channel.id}'),
channel: channel,
child: StreamBuilder<DateTime>(
initialData: channel.updatedAt,
stream: channel.updatedAtStream,
builder: (context, snapshot) {
child: Builder(
builder: (context) {
Widget child;
if (widget.channelPreviewBuilder != null) {
child = Stack(