Skip to content

Commit 41dff48

Browse files
gnpricechrisbobbe
authored andcommitted
msglist [nfc]: Rename scroll-metrics callbacks more accurately
The main method here was accurately named when first introduced in 5abeb88. But then in bccaead its job broadened, so it should get a more generic name. (This was basically a mismerge, I think. The latter commit was originally written first, so the original draft would have had its own set of methods, and when I rebased atop the former commit I apparently didn't do the refactoring that was then called for.)
1 parent e1bff3e commit 41dff48

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/widgets/message_list.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
213213
});
214214
}
215215

216-
void _adjustButtonVisibility(ScrollMetrics scrollMetrics) {
216+
void _handleScrollMetrics(ScrollMetrics scrollMetrics) {
217217
if (scrollMetrics.extentAfter == 0) {
218218
_scrollToBottomVisibleValue.value = false;
219219
} else {
@@ -232,11 +232,11 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
232232
}
233233

234234
void _scrollChanged() {
235-
_adjustButtonVisibility(scrollController.position);
235+
_handleScrollMetrics(scrollController.position);
236236
}
237237

238-
bool _metricsChanged(ScrollMetricsNotification scrollMetricsNotification) {
239-
_adjustButtonVisibility(scrollMetricsNotification.metrics);
238+
bool _handleScrollMetricsNotification(ScrollMetricsNotification notification) {
239+
_handleScrollMetrics(notification.metrics);
240240
return true;
241241
}
242242

@@ -262,7 +262,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
262262
child: ConstrainedBox(
263263
constraints: const BoxConstraints(maxWidth: 760),
264264
child: NotificationListener<ScrollMetricsNotification>(
265-
onNotification: _metricsChanged,
265+
onNotification: _handleScrollMetricsNotification,
266266
child: Stack(
267267
children: <Widget>[
268268
_buildListView(context),

0 commit comments

Comments
 (0)