Skip to content

Commit 1af88a0

Browse files
committed
wip msglist: Show loading indicator at bottom as well as top; TODO test
1 parent 056e024 commit 1af88a0

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

lib/widgets/message_list.dart

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -745,13 +745,21 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
745745
}
746746

747747
Widget _buildEndCap() {
748-
return Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
749-
TypingStatusWidget(narrow: widget.narrow),
750-
MarkAsReadWidget(narrow: widget.narrow),
751-
// To reinforce that the end of the feed has been reached:
752-
// https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20Mark-as-read/near/1680603
753-
const SizedBox(height: 36),
754-
]);
748+
if (model.haveNewest) {
749+
return Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
750+
TypingStatusWidget(narrow: widget.narrow),
751+
// TODO perhaps offer mark-as-read even when not done fetching?
752+
MarkAsReadWidget(narrow: widget.narrow),
753+
// To reinforce that the end of the feed has been reached:
754+
// https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20Mark-as-read/near/1680603
755+
const SizedBox(height: 36),
756+
]);
757+
} else if (model.busyFetchingMore) {
758+
// See [_buildStartCap] for why this condition shows a loading indicator.
759+
return const _MessageListLoadingMore();
760+
} else {
761+
return SizedBox.shrink();
762+
}
755763
}
756764

757765
Widget _buildItem(MessageListItem data) {

0 commit comments

Comments
 (0)