Skip to content

Commit 5f457a4

Browse files
committed
msglist [nfc]: Simplify name of _scrollToBottomVisible
This isn't a "value"; it's a "value notifier", which has a value. We could call it "… notifier" instead; but the type seems adequate already for disambiguating that.
1 parent c32edc8 commit 5f457a4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/widgets/message_list.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ class MessageList extends StatefulWidget {
467467
class _MessageListState extends State<MessageList> with PerAccountStoreAwareStateMixin<MessageList> {
468468
MessageListView? model;
469469
final ScrollController scrollController = MessageListScrollController();
470-
final ValueNotifier<bool> _scrollToBottomVisibleValue = ValueNotifier<bool>(false);
470+
final ValueNotifier<bool> _scrollToBottomVisible = ValueNotifier<bool>(false);
471471

472472
@override
473473
void initState() {
@@ -485,7 +485,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
485485
void dispose() {
486486
model?.dispose();
487487
scrollController.dispose();
488-
_scrollToBottomVisibleValue.dispose();
488+
_scrollToBottomVisible.dispose();
489489
super.dispose();
490490
}
491491

@@ -512,9 +512,9 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
512512

513513
void _handleScrollMetrics(ScrollMetrics scrollMetrics) {
514514
if (scrollMetrics.extentAfter == 0) {
515-
_scrollToBottomVisibleValue.value = false;
515+
_scrollToBottomVisible.value = false;
516516
} else {
517-
_scrollToBottomVisibleValue.value = true;
517+
_scrollToBottomVisible.value = true;
518518
}
519519

520520
if (scrollMetrics.extentBefore < kFetchMessagesBufferPixels) {
@@ -578,7 +578,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
578578
child: SafeArea(
579579
child: ScrollToBottomButton(
580580
scrollController: scrollController,
581-
visibleValue: _scrollToBottomVisibleValue))),
581+
visible: _scrollToBottomVisible))),
582582
])))));
583583
}
584584

@@ -691,9 +691,9 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
691691
}
692692

693693
class ScrollToBottomButton extends StatelessWidget {
694-
const ScrollToBottomButton({super.key, required this.scrollController, required this.visibleValue});
694+
const ScrollToBottomButton({super.key, required this.scrollController, required this.visible});
695695

696-
final ValueNotifier<bool> visibleValue;
696+
final ValueNotifier<bool> visible;
697697
final ScrollController scrollController;
698698

699699
Future<void> _navigateToBottom() {
@@ -710,7 +710,7 @@ class ScrollToBottomButton extends StatelessWidget {
710710
Widget build(BuildContext context) {
711711
final zulipLocalizations = ZulipLocalizations.of(context);
712712
return ValueListenableBuilder<bool>(
713-
valueListenable: visibleValue,
713+
valueListenable: visible,
714714
builder: (BuildContext context, bool value, Widget? child) {
715715
return (value && child != null) ? child : const SizedBox.shrink();
716716
},

0 commit comments

Comments
 (0)