fix: scrollToBottom not respecting false value

This commit is contained in:
Gordon Hayes
2022-02-18 15:26:44 +01:00
parent b4182a0a11
commit cfb41dd629
2 changed files with 15 additions and 13 deletions
@@ -712,20 +712,21 @@ class _MessageListViewState extends State<MessageListView> {
);
},
),
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.showScrollToBottom)
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),
],