diff --git a/tracking_flutter/lib/graph/view/widgets/months_selection.dart b/tracking_flutter/lib/graph/view/widgets/months_selection.dart index c7c2a79..7a35643 100644 --- a/tracking_flutter/lib/graph/view/widgets/months_selection.dart +++ b/tracking_flutter/lib/graph/view/widgets/months_selection.dart @@ -33,7 +33,7 @@ class _MonthsSelectionState extends State<_MonthsSelection> { super.initState(); scrollController = ScrollController( - initialScrollOffset: _getScrollOffset(), + initialScrollOffset: _getSelectedMonthScrollOffset(), ); WidgetsBinding.instance.addPostFrameCallback((_) { @@ -56,7 +56,7 @@ class _MonthsSelectionState extends State<_MonthsSelection> { } void _scrollToSelectedMonth() { - final scrollOffset = _getScrollOffset(); + final scrollOffset = _getSelectedMonthScrollOffset(); if (scrollController.hasClients && scrollOffset != scrollController.offset) { @@ -162,7 +162,7 @@ class _MonthsSelectionState extends State<_MonthsSelection> { ); } - double _getScrollOffset() { + double _getSelectedMonthScrollOffset() { final selectedMonthIndex = widget.selectedMonth - 1; return math .max( diff --git a/tracking_flutter/lib/graph/view/widgets/weeks_selection.dart b/tracking_flutter/lib/graph/view/widgets/weeks_selection.dart index 5ee6612..f3fa418 100644 --- a/tracking_flutter/lib/graph/view/widgets/weeks_selection.dart +++ b/tracking_flutter/lib/graph/view/widgets/weeks_selection.dart @@ -32,7 +32,7 @@ class _WeeksSelectionState extends State<_WeeksSelection> { super.initState(); scrollController = ScrollController( - initialScrollOffset: _getScrollOffset(), + initialScrollOffset: _getSelectedWeekScrollOffset(), ); WidgetsBinding.instance.addPostFrameCallback((_) { @@ -55,7 +55,7 @@ class _WeeksSelectionState extends State<_WeeksSelection> { } void _scrollToSelectedWeek() { - final scrollOffset = _getScrollOffset(); + final scrollOffset = _getSelectedWeekScrollOffset(); if (scrollController.hasClients) { scrollController.animateTo( @@ -159,7 +159,7 @@ class _WeeksSelectionState extends State<_WeeksSelection> { ); } - double _getScrollOffset() { + double _getSelectedWeekScrollOffset() { final selectedWeekIndex = widget.selectedWeek - 1; return math .max(