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>(
valueListenable: _showScrollToBottom,
child: _buildScrollToBottom(),
builder: (context, value, child) {
if (!streamChannel!.channel.state!.isUpToDate || value) {
return child!;
}
return const Offstage();
},
BetterStreamBuilder<bool>(
stream: streamChannel!.channel.state!.isUpToDateStream,
initialData: streamChannel!.channel.state!.isUpToDate,
builder: (context, snapshot) => ValueListenableBuilder<bool>(
valueListenable: _showScrollToBottom,
child: _buildScrollToBottom(),
builder: (context, value, child) {
if (!snapshot || value) {
return child!;
}
return const Offstage();
},
),
),
if (widget.showFloatingDateDivider)
_buildFloatingDateDivider(itemCount),