fix(ui): use isUpToDateStream

This commit is contained in:
Salvatore Giordano
2021-10-27 16:29:34 +02:00
parent 34eaae7a8c
commit e65843963e
@@ -647,15 +647,19 @@ class _MessageListViewState extends State<MessageListView> {
); );
}, },
), ),
ValueListenableBuilder<bool>( BetterStreamBuilder<bool>(
valueListenable: _showScrollToBottom, stream: streamChannel!.channel.state!.isUpToDateStream,
child: _buildScrollToBottom(), initialData: streamChannel!.channel.state!.isUpToDate,
builder: (context, value, child) { builder: (context, snapshot) => ValueListenableBuilder<bool>(
if (!streamChannel!.channel.state!.isUpToDate || value) { valueListenable: _showScrollToBottom,
return child!; child: _buildScrollToBottom(),
} builder: (context, value, child) {
return const Offstage(); if (!snapshot || value) {
}, return child!;
}
return const Offstage();
},
),
), ),
if (widget.showFloatingDateDivider) if (widget.showFloatingDateDivider)
_buildFloatingDateDivider(itemCount), _buildFloatingDateDivider(itemCount),