fix(ui): use isUpToDateStream

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