Skip to content

Commit daac68e

Browse files
committed
wip msglist show loading indicator at bottom too; TODO test
1 parent 4c47629 commit daac68e

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
@@ -736,13 +736,21 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
736736
}
737737

738738
Widget _buildEndCap() {
739-
return Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
740-
TypingStatusWidget(narrow: widget.narrow),
741-
MarkAsReadWidget(narrow: widget.narrow),
742-
// To reinforce that the end of the feed has been reached:
743-
// https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20Mark-as-read/near/1680603
744-
const SizedBox(height: 36),
745-
]);
739+
if (model.haveNewest) {
740+
return Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
741+
TypingStatusWidget(narrow: widget.narrow),
742+
// TODO perhaps offer mark-as-read even when not done fetching?
743+
MarkAsReadWidget(narrow: widget.narrow),
744+
// To reinforce that the end of the feed has been reached:
745+
// https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20Mark-as-read/near/1680603
746+
const SizedBox(height: 36),
747+
]);
748+
} else if (model.busyFetchingMore) {
749+
// See [_buildStartCap] for why this condition shows a loading indicator.
750+
return const _MessageListLoadingMore();
751+
} else {
752+
return SizedBox.shrink();
753+
}
746754
}
747755

748756
Widget _buildItem(MessageListItem data) {

0 commit comments

Comments
 (0)