Skip to content

Commit 7eaea54

Browse files
gnpricechrisbobbe
authored andcommitted
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 7dfad7c commit 7eaea54

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
@@ -466,7 +466,7 @@ class MessageList extends StatefulWidget {
466466
class _MessageListState extends State<MessageList> with PerAccountStoreAwareStateMixin<MessageList> {
467467
MessageListView? model;
468468
final ScrollController scrollController = MessageListScrollController();
469-
final ValueNotifier<bool> _scrollToBottomVisibleValue = ValueNotifier<bool>(false);
469+
final ValueNotifier<bool> _scrollToBottomVisible = ValueNotifier<bool>(false);
470470

471471
@override
472472
void initState() {
@@ -484,7 +484,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
484484
void dispose() {
485485
model?.dispose();
486486
scrollController.dispose();
487-
_scrollToBottomVisibleValue.dispose();
487+
_scrollToBottomVisible.dispose();
488488
super.dispose();
489489
}
490490

@@ -511,9 +511,9 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
511511

512512
void _handleScrollMetrics(ScrollMetrics scrollMetrics) {
513513
if (scrollMetrics.extentAfter == 0) {
514-
_scrollToBottomVisibleValue.value = false;
514+
_scrollToBottomVisible.value = false;
515515
} else {
516-
_scrollToBottomVisibleValue.value = true;
516+
_scrollToBottomVisible.value = true;
517517
}
518518

519519
if (scrollMetrics.extentBefore < kFetchMessagesBufferPixels) {
@@ -577,7 +577,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
577577
child: SafeArea(
578578
child: ScrollToBottomButton(
579579
scrollController: scrollController,
580-
visibleValue: _scrollToBottomVisibleValue))),
580+
visible: _scrollToBottomVisible))),
581581
])))));
582582
}
583583

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

692692
class ScrollToBottomButton extends StatelessWidget {
693-
const ScrollToBottomButton({super.key, required this.scrollController, required this.visibleValue});
693+
const ScrollToBottomButton({super.key, required this.scrollController, required this.visible});
694694

695-
final ValueNotifier<bool> visibleValue;
695+
final ValueNotifier<bool> visible;
696696
final ScrollController scrollController;
697697

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

0 commit comments

Comments
 (0)