Skip to content

Commit 32ee272

Browse files
committed
wip msglist show loading indicator at bottom too; TODO test
1 parent 5af4545 commit 32ee272

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
@@ -704,13 +704,21 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
704704
}
705705

706706
Widget _buildEndCap() {
707-
return Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
708-
TypingStatusWidget(narrow: widget.narrow),
709-
MarkAsReadWidget(narrow: widget.narrow),
710-
// To reinforce that the end of the feed has been reached:
711-
// https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20Mark-as-read/near/1680603
712-
const SizedBox(height: 36),
713-
]);
707+
if (model.haveNewest) {
708+
return Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
709+
TypingStatusWidget(narrow: widget.narrow),
710+
// TODO perhaps offer mark-as-read even when not done fetching?
711+
MarkAsReadWidget(narrow: widget.narrow),
712+
// To reinforce that the end of the feed has been reached:
713+
// https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20Mark-as-read/near/1680603
714+
const SizedBox(height: 36),
715+
]);
716+
} else if (model.busyFetchingMore) {
717+
// See [_buildStartCap] for why this condition shows a loading indicator.
718+
return const _MessageListLoadingMore();
719+
} else {
720+
return SizedBox.shrink();
721+
}
714722
}
715723

716724
Widget _buildItem(MessageListItem data) {

0 commit comments

Comments
 (0)